Fix crash on keys containing non-latin1 symbols

Fix crash on key values with non-latin1 symbols due to negative hash value).