Fix #163: Detect model inheritance for classes that are scanned in different paths.

Includes the #164 patch