Added encode_optional_parameters(). Need to add decode_optional_parameters.