Fixed error in caching.