Adding support for replica sets.