Improved type checking.