Implement type checking.