Fixed tuple generation code and tuples are now returned by generator