Fixed another bug in generate.