Fixing S3 error handling issues.