Fixed a bug caused by incomplete timing of incrementing ticket_tail.