Fixed some bugs in repl.js