Remove whitespace that caused headers to be sent prematurely