Fix up the error handling in the REPL.