Modifications to support S3