Fix off-by-one error in looking up datapaths by index.