Added support for replica sets.