Make header parsing issues faster, and make tests pass on Thunderbird