Fix bugs for footnotes