Fix some unit tests that are failing sometimes against replica sets.