When deleting file tree nodes, make sure the parent directory remains a directory.