Fixed some problems with generator script.