Fix test race

These changes help the tests run on my system.