Fix tlv length encoding issue