Fix some non-deterministic behavior in the specs, found by Travis