Minor fix for `validate_max_length` function.