Fix bugs with filter