Fix bug in the new extract-children, and simplify wrapping