Some more work on type checking