Fixed a bug when working with keystone identity.

Taken from pull request #113.