Improve subtype scanning

Handle classes with identical names from different packages.

Improved handling for objects.