change generate_code repair a problem, and repair a bug about check tool.