Fix bug in inheritence.