Fixed sequence number wrapping issue