Fix an infinite loop in GetFlaggedRangesOfCharChunk