fix incorrect inverted filter handling (and test)