More caching fixes for tests