Fix a bug with recursive deleting