Make replica set configuration more robust