Make equalsNode work with pointers to subtypes.