Fixed undo action causing hang when applying an action with *many* steps
