Fix undo once and for all