Fixed bugs in redo