Fix getHTTPStatusCode function