Add missing length calculation.