s3 and related fixes