Fix some bugs with the header sent to the browser.