fix type_and_length calculation when setting short_length