Merge "Handle the cases where the segment isn't long enough." into main