Handle more broken headers, slight optimization