Fixup for main generation code
Merge pull request #2808 from yebblies/gencmain

[DDMD] Fixup for main generation code