Fix a bug with overwriting original files if cacheDir is empty, resoves #181