corrected class real-length calculation (missing after last refactoring)