Couple of caching bugfixes