Fix buggy caching