Fixed REPL procedure