Fixed a mismatch between cache and database when running unit tests.