Fix caching bug and add CachingClusteredClient tests