Fixed configuration and tests to correctly work for replicaset