If an open of an existing file fails, such as when a header value conflicts with the expected value, close the file before throwing the exception. (Thanks to Zach Laine for the problem report!)
Do a tiny bit of work on docs.