Fix mouse mode not changing on selection undo.