Added cURL options to avoid SSL errors and fix $self wrongly used