Fixed concurrency issues with the cache dictionaries.

All 148 tests pass.