fixes to parsing