fix some parser bugs