Improved the generated code for Factor sub-objects.