Fix horrible bug where get_children was returning tons of duplicate children. Don't append to the list you're iterating over.
Don't generate p_path unless we're going to need it. Do the cheaper comparison first.