bugfixes and improvements to the ghttp library