Changed calculation position in hdrbuf