Only use custom curl if necessary (fixed and improved)