Fix hashing for instances