Bug fix in metadata credential caching