Fixes KeyError when resetting an input file

If the file hadn't been changed before trying to reset it, KeyError was
raised.