Fixed filtering for the 'not in' case