Enhance error message when reading binary input files

Resolves #1158