REPL works but hangs on exception