Finally working, fixed return statement type checking, inherited types