Fix a bug with S3 storage endpoints