Initially, I thought the first one was okay, until I noticed him grabbing the fielder's pants leg and pulling him down.
The second was illegal and correctly ruled as such. Wide of the base, couldn't hold the base AND again reached for the leg. He did something similar to Gregorius last year IIRC.
What I don't get is as a middle infielder, one would think he wouldn't like it when somebody does that to him.
The other day in the game thread, some were talking briefly about Machado and Bregman. Bregman is a PITA but so far, it's because he's really good. He reminds me a little of Pedroia from a decade ago; Machado is a very talented punk.