Fix removal of elements on undo. Fixes #410