Fixed generate_csv