Fixed a cleanup bug when a reconnect completely fails.