[Equality] fix the equality and hash functions to actually work