A bit refactoring to the new inheritance code. Tested with 3 previously known inheritance issues.