Fix write(Char)
Misc changes for REPL