Fixed lib/generate.js