Fixing generate script