Further adjustments to mimeheader parsing.

Previous commit concerning this had issues in certain situations