Fix fencepost errors for row-major indexing.
Fix fencepost errors for row-major indexing.

abingham/segpy,hohogpb/segpy,kwinkunks/segpy,asbjorn/segpy,Kramer477/segpy,stevejpurves/segpy,kjellkongsvik/segpy