fixed file leak issue with short files, and added a helpful warning message to handle other types of errors.