In genFunction, the parameters are collected into a tuple for encoding.
This works for primitive types (e.g., int, string), but with objects it produces a tuple of objects.
The recommended approach, I guess, is to transform objects into tuples prior to encoding.