More work on the undo system