Improve some error messages with malformed files

(much more useful when you
are given the incriminated file name)