Minor improvements and fixes to the parser