Pulled in monkey patches from https://github.com/aws/aws-sdk-ruby/pull/22