Fix footnote bug regarding placement of footnotes