Handle up to 9999 footnotes, not 999.