BUG: S3 connection arguments

I think you had the if-else logic in the wrong order.