Scripts checking for file type

Kovi's reported error made it necessary to also include code to display more useful error messages if the wrong file format was detected.