Various fixes in the parser