Fix a bug in `FileManager.getAllFiles()` and use `window.debug`