Fix redo logic.