Handle large numbers of numbered headings

In some situations where there are large numbers of numbered headings
the numbers were running into the heading. This was causing lots of
problems if the headings with year numbers as they looked to be one long
number.