fixing http header parsing. fixing debug printing.