Fix filtering bug in percentile calculator.