Fix the bug of exporting sub-tree.