Bug fixes to the HTTP protocol code