fixed handling to inheritance issues, added inheritance cycles detection