Fix performance issues with Section/Subsection.