Fix non-deterministic behavior.