Yeah, I agree it was close.
JMM landed some good shots, but he was less active and less accurate. I think if Beristain had told him "you're behind, you need to knock him out" and he went out and threw like he wanted to finish the fight the final 3 rounds, he would have won.