fix DScriptGenerator bugs