Fix a couple of races in testing.