Small changes in tree creation. Bug fixed.