Fix issues in --invert-match logic.
Merge pull request #437 from aeriksson/fix-invert-match

Fix issues in --invert-match logic.