core: Fix caching