some useful fixes about initial headers and content-lenght