Fixes hashes with multibyte characters in them