Fix bug in headers (content type written twice)