Fix max_retries