Fix the generated script