Off-by-one error in search selection.