Fixed race conditions on (occasionally) failing tests.