Fix some errors in parser