Fixed some Apache HTTP client code issues