Fixes issue when deleting note items that have parent items.