Fix filter logic.