Fix issues in --invert-match logic.