Fix unit test determinism