Fixed a formatting bug for header and footer format. Also added the option of header_div_char and footer_div_char in order to specify the characters to be used for the relevant dividers.