Fixed some more problems when running unit tests against replica sets.