Small fix for inserting and deleting