Fix variable names in output_final_sequences