Do not keep children when leavesOnly is true