Fix cache_dir not defined.