Fix problems generating functions with 10 or more arguments

Mainly useful for record constructors which are automatically generated.