A number of small fixes, added inheritance