Fix issues with non-deterministic global test state