Fixed errors, added CURL options