Fixes order for children of excluded parents

Fixes an issue where children of excluded parents always get appended to end of the tree, not according to their order.