Fixed a disconnection bug.

Forgot to set isConnected to false when disconnecting.