Handle replicaset connections better