Fixed issues with selection when items are removed