Fixed some typos, added top-level handling of bad files.
Factored out common archive walking behaviour.