Solve tree merge issue

Solve issue from https://github.com/Lhfcws/rdir/issues/3