properly handle deleting of folders from the 'File' menu, add test