Fixed concurrency problem in the internal cache.