Merge "Fix off-by-one bounds checking bug."