Fixed #454: fixed parsing of headers