fixes for bugs in parser