Merge pull request #5359 from tniessen/make-type-mismatch-errors-consistent Make type mismatch errors consistent