Fix serialization of FunctionToken