Fix bug in generate_data and indentation