bug fixes in the parser