The best thing to do in those cases is to take a quick re-start and shot on goal. Did Lex. do that?
If they did and scored and then ref blew whistle, he was in error. You can't allow a team to interfere with play or restart just because of a foul.