Change the order of checking for semicolons