Fixed bug in delete.