fix nesting of header types and set the message content type correctly