Fix a bug that occurred when deleting a folder recursively.