Improving error messages for type checking.