Split out type checking function into two.
Added error when invoking parent class.
Simplify of definition