Fixes for proper replicaset detection