Fix tree creation.