More fixes for cache handling