Fix tests that were failing with unstable MongoDB.