Fix bug with disconnecting.