fixes provided by qiou21@github.com, dealing with S3 paths and non-ASCII
symbols