More useful error messages when opening input file