Fix hash function