Fixing handling of dropped socket.