Fixes issue with clashing key names in instance hash

Works with both single instance connections and replica sets