Added check for inheritance/composition recursion