Bug with removal undo + selection

*First problem:*
When you remove an element and then undo, that element is not selected.

*Second problem:*
Steps to reproduce:
1. Create 2 textboxes.
2. Select one of them and delete it.
3. Select second text box.
4. Undo.

Actual result:
Both textboxes are selected.

Expected:
Only first one is selected (the one which was un-removed).