Fixes to headers sent