Fix delete functionality.