Let's give more information when we fail, to simplify debugging.
Updated with most recent releaes, to keep this repo in sync with what we have on Amazon S3.
Rearranged elements in a more logical order.