fixed off-by-one bug in extract_to_footer()