Fixing problems with multiple levels of inheritance