Moved set -e for when curl fails silently, cleanup