More changes to script generation