Fixing cache bugs