Deleting selected nodes breaks selection mechanism.

The variable pointing to selection still holds a reference to the
deleted node. blur() must be called before removing dom elemenets.