Fix reporting of errors to the repl
Handle parse errors robustly