Fixed test that was occasionally failing due to randomness.