Fix tree clone.

Signed-off-by: Toha <tohenk@yahoo.com>
Optimize replaceTextEx.

Signed-off-by: Toha <tohenk@yahoo.com>