REPL history: fix bug in reading back history modes.