Improved implementation of inheritance.