Added recursive inheritance prevention