Fix index-filter with test

Better test coverage still needed, but this hits the major case.