Fixed hang on bad socket connection.