Update scripts to use bash, some fixes to generator scripts