Fixed minor bug in cache manager where a file could get harmlessly overwritten when it didn't need to be