fixed rounding issues for length