Improved error handling and user feedback in the repl