minor bugfixes in http library
minor bugfixes and improvements around http library