Fix constant hashing and equality for unhashable/uncomparable constant values