Fixed a bug when deleting snapshots