Fix cache handling