Fix rule-of-3 issue in generate_sequence