Correct of leaves() functions.
Add copy() function.
Optimizing.