Fix filter code