Added root_node() helper function, fixed traversal issues