Fix tree structure