Bugfix for S3 encoding