Fixed redundant curl error checking. Untested.