fixed bugs that seemed to have come in from a merge that took away S3 functionality