Fixes to parsing