Fix bug in setting headers.