TSAGE: R2R - Correct possible out of range accesses checks.

These had an off-by-one error in the upper bound check.
This should fix the remaining warnings reported as bug #6621.