Made dict.popitem deterministic