Bug fixes related to first segment of the tree