Fixed broken undo after chain of backspace actions.

When you press 'backspace' few times and then try roll back action the result isn't expected.