Fix DTSN sequence logic. Including when seq wraps around