Fix bugs in Delete feature