Fix to _retrievedText/_docChanges off-by-one miscalculation. The culprit was incorrectly calculated totalLength.