[HOTFIX] Fix list to tree function for unsorted paths