Fix get_sequence_number bug