Fix handling of parse errors