Respect directive order when writing trees

Created by  korrat  on December 17, 2022
X6YJF46GPT3KOVC3MJPJRPWLW6PEECFXFJLMFHDFOADYJGX3EXUQC
Change contents