Fix bug where sharding code erroneously detects replica sets.