Fixes to parser