Remove some warnings.
Simplify filter algorithm.