Re-add safe version of s3.rb