Fixed code issues from repl