Introduced a compatibility bug in the previous commit, related to to_h being non present in older versions of ruby.