Fix problem with dynamic adding, inserting and removing