Bugfixes in reconnection logic.