Fix errors with codegen when invoking yielder function that returns