Corrected bugs in parser.cpp