S3 Script: Bug Fixes