Fixed undo for undoing marked tasks