Changes for jclouds #1491 and jclouds #1487

Applied the changes for [jclouds #1491](https://github.com/jclouds/jclouds/pull/1491) and [jclouds #1487](https://github.com/jclouds/jclouds/pull/1487)

/cc @andrewgaul @everett-toews