Small changes to make the process more consistent when you have an invalid file.