Fix off-by-one issue with hierarchy swap.

This stops headings being needlessly repeated when moving within a section.