Wrong check for curl error refs #9