Fix cache management