Fix strings length calculation