Only add _type to IdentityMap if using inherited class

#2697 was forcing _type on all classe when pushing to identityMap. We must use the _type on the selector only when using subclasses.
[Fixes #2916]