Fixed wrong context in call to get_children for tree, which needs root. Thanks @j23d. Fixed tests that had wandered off around that bug.