Sort generation in generate_kettle