Cleanup error streams in httputils
Unit test improvement