Some fixes for filtering