Correct the walktree function to avoid putting the flowRef on the parent node.