don't trigger bool overrides when checking for object instance type

This commit has a fix and a test for objects that fail the InstanceOf check because their overridden bool behavior gets accidentally triggered. This is important when dealing with PDL objects.