Fix filter-only and filter-out.
Turn is_leaf() into property.
Improve tests.