Fix cache cleaning when cache directory doesn't exist