Fix bugs in parser.