Fix onFileEvent and onFolderEvent handlers