Fix for unsorted hashes causing spec failures on 1.8