This improves header handling.

Fixes issue #29.