LegacyTreeWriter now writes header hash based on correctly filled header structure.
LegacyTreeWriter shifts entries form root group to first group, or stores root group with entries when no other group is present.