Fixing exception when reopening a replica set

I was attempting to reconnect to a replica set after disconnecting, but the native driver is throwing exceptions. I made a minor fix so that this is possible.