Fix bug in hashing