Fixed repl hang on connection errors