Fixed issues where multiple disconnects breaks reconnecting.