Simplify code.
Fix error when there is no filter.