Filter on both input and output.