Fix bug in type object equality semantics