Fixed some memory leaks.

Did not delete the associated data when updating item. Did not
delete the assoc. data when DeleteAllItems.