Added compatibility for Mongo replica sets.