Fix bug in insert_next()