OCaml: several fixes required for sending text to utop REPL