Bug fixed (and some refactoring): crash on local removal of a folder