Fixed rare cwd access issue