#1038 Cleaned up reconnect logic