fix repl, improve test, fix repl rules