Fixed cache file recognition
and some other changes