Bugfix: handle last heading that falls after a run of headings below the size cutoff