Improving generated scripts to avoid useless forks.