Fixed some error checking in the parser
Fixed up a few more things