Fix typos in archive_pathmatch logic.

This was explored in pull request #78 by github user maksqwe.
After considering the alternatives, I think the existing
behavior was correct (but the comments were wrong and there was
extraneous code).  Extended tests to cover this case and some
other cases that were not fully exercised.