Improve error messages around kind mismatches.