file cache: fix some bugs