Fixed some nasty memory business in the parser