Fix in TSCircularBuffer to prevent math range error.