Fix a bug in the header parsing