Correct bugs in generation.