Improvements in type checking