fixed bugs in the parser