Correctly report and handle an attempt to open a wrong file type. (Bug #206)