fixed a few parse_header bugs