fix appendSection/setSections edge-case issues