Properly fixed inverting in filter

- Fixed inversion bug in filter correctly
- Modified all filtering tests to also check that the number of ids, classes and feature rows are always equal after fitering,