Take offset rounding into account when rounding the length of segment
size.

Fixes: #1469