Better reporting of errors when loading files