Fixed most inheritance problems