Fix bug in captured header parsing