Fix char hashing function