Fix off-by-one in selection.