Remove unused code and return correct S3 errors

Fixes EUCA-10221