Fixed type errors when calling applyCache.