Corrected delete functionality.