Fix cache internal data issues