Fix bug where selection after update was wrong