Some more fixes to the parsing code