Updated to add retries, and alter connection timeouts.