Fix filtering when loosening query