Refactor string buffer size
Fix rotation rounding error
Increase segment compensation