Fixed bugs around length fields.