Better error checking on curl_dl