Fixed the delete error. Delete is function is handled by insert.
Updating the close functions.