Fixed some errors with the delete