Fixes for automatic footnote numbering