Term type checking implemented