Only call IdentityMap.clear if IdentityMap has been defined