Fix removal of selected rows. (See #10539)