My ugly kluge to make pkg_rmleaves work