diff --git a/Changes.md b/Changes.md
index c309f4ad0..3bbf476d5 100644
--- a/Changes.md
+++ b/Changes.md
@@ -7,12 +7,13 @@ MAD-X master
 *   [PR 1095](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1095) Implement more robust, optional, PTC DA map output (L. Deniau)
 *   [PR 1088](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1088) Additional explanation bv flag (J. Dilly)
 *   [PR 1113](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1113) Introduce LAST option in INSTALL and MOVE and change default behaviour [Breaking change!] (R. De Maria)
-*   [PR 1131](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1131) Add spin table (P. Skowonronski)
+*   [PR 1131](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1131) Add spin table (T. Persson and P. Skowonronski)
 *   [PR 1093](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1093) Refine aperture refinement(T. Persson)
 *   [PR 1114](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1114) Exact option in translation(J. S. Berg)
 *   [PR 1111](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1111) Ensure that exact_model is set before zero_key is called
 *   [PR 1125](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1125) Make TWISS treat [XY]ROTATION exactly, including the linear and second order map (J. S. Berg)
 *   [PR 1129](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1129) Make track/twiss able to treat a thick solenoid exactly
+*   [PR 1133](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1133) Fix the Dqmin calculation when the CHROM option was used. (T. Persson)
 
 MAD-X release 5.08.01 (2022.02.25)
 
diff --git a/src/twiss.f90 b/src/twiss.f90
index 292f79e72..97dca5f0e 100644
--- a/src/twiss.f90
+++ b/src/twiss.f90
@@ -1250,7 +1250,9 @@ SUBROUTINE twcpin(rt,disp0,r0mat,eflag)
   dqmin_rdt_c=0
   dqmin_det_c=0
   diff_bigger_sum = 0
-  
+  prev_pos_s = 0
+  tot_int_length = zero
+
   !--- initialize deltap because twcpin can be called directly from mad_emit
   deltap = get_value('probe ','deltap ')
 
@@ -3590,7 +3592,6 @@ SUBROUTINE tw_summ(rt,tt)
   !     call fort_warn('Chromaticity calculation wrong due to coupling, ',&
   !                    'use chrom option or manual calculation')
   ! endif
-  
   dqmin2 = 4d0*abs(delta_tune_dqmin/twopi)*(abs(dqmin_rdt)/tot_int_length)
   dqmin_ph = atan2(aimag(dqmin_rdt), real(dqmin_rdt))
   if(diff_bigger_sum/dqmin_rdt_c .gt. 0.1 .and. dqmin2 .ge. 1e-8) then
diff --git a/tests/test-c6t-2/test-c6t-2.ref b/tests/test-c6t-2/test-c6t-2.ref
index 151e689a8..319ea46e6 100644
--- a/tests/test-c6t-2/test-c6t-2.ref
+++ b/tests/test-c6t-2/test-c6t-2.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.07.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2021.05.03               +
-  + Execution date: 2021.12.10 13:03:53      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:02:16      +
   ++++++++++++++++++++++++++++++++++++++++++++
 TITLE;
 
diff --git a/tests/test-c6t-3/test-c6t-3.ref b/tests/test-c6t-3/test-c6t-3.ref
index af110209c..b31b7276e 100644
--- a/tests/test-c6t-3/test-c6t-3.ref
+++ b/tests/test-c6t-3/test-c6t-3.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:47:37      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:02:17      +
   ++++++++++++++++++++++++++++++++++++++++++++
 TITLE;
 
@@ -68,10 +68,10 @@ orbit:   0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0004694091789 
+                 0                  0                  0      0.01110391184 
 
        dqmin_phase 
-       3.046048374 
+      -1.665618099 
   ++++++++++++++++++++++++++++
   +   c6t version 2.0        +
   ++++++++++++++++++++++++++++
diff --git a/tests/test-c6t-5/afterTrom.twiss.ref b/tests/test-c6t-5/afterTrom.twiss.ref
index f74c29c8a..33e6a2c4e 100644
--- a/tests/test-c6t-5/afterTrom.twiss.ref
+++ b/tests/test-c6t-5/afterTrom.twiss.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le     4.439824994e-09
-@ DQMIN_PHASE      %le         3.014430198
+@ DQMIN            %le     3.082367563e-08
+@ DQMIN_PHASE      %le         1.495395699
 @ TITLE            %08s "no-title"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.48.02"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "05.21.18"
 * NAME                                X                  Y               BETX               BETY                MUX                MUY                 PT                  T 
 $ %s                                %le                %le                %le                %le                %le                %le                %le                %le 
  "SEQ$START"             0.002907156139       0.0967802983        33.60963339        8.655352869                  0                  0    0.0001609191543   -0.0007344539478
diff --git a/tests/test-c6t-5/test-c6t-5.ref b/tests/test-c6t-5/test-c6t-5.ref
index fc438df7f..c406340f4 100644
--- a/tests/test-c6t-5/test-c6t-5.ref
+++ b/tests/test-c6t-5/test-c6t-5.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:48:02      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:02:39      +
   ++++++++++++++++++++++++++++++++++++++++++++
 circum=120.;
 
@@ -200,10 +200,10 @@ orbit:   4.733614E-03  2.906454E-04  1.382562E-01 -7.404873E-03 -9.455828E-04  2
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    4.018958487e-10 
+                 0                  0                  0      3.2621048e-08 
 
        dqmin_phase 
-       3.073733918 
+      -1.643084735 
 betxLOC.BIM=table(twiss,markLOC.BIM,betx);betyLOC.BIM=table(twiss,markLOC.BIM,bety);
 
 alfxLOC.BIM=table(twiss,markLOC.BIM,alfx);alfyLOC.BIM=table(twiss,markLOC.BIM,alfy);
@@ -301,10 +301,10 @@ orbit:   2.907156E-03  1.362662E-04  9.678030E-02 -8.782200E-03 -7.344539E-04  1
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    4.439824994e-09 
+                 0                  0                  0    3.082367563e-08 
 
        dqmin_phase 
-       3.014430198 
+       1.495395699 
 sixtrack, CAVALL;	
 
   ++++++++++++++++++++++++++++
diff --git a/tests/test-cororbit-2/resultb1.ref b/tests/test-cororbit-2/resultb1.ref
index 60dc96ce8..5bb68936b 100644
--- a/tests/test-cororbit-2/resultb1.ref
+++ b/tests/test-cororbit-2/resultb1.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le     5.589320539e-05
-@ DQMIN_PHASE      %le     -0.004795216736
+@ DQMIN            %le     0.0008807982516
+@ DQMIN_PHASE      %le         1.330576198
 @ TITLE            %62s "LHC 6.503 with errors and two beam orbit correction using MADX"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.47.06"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "02.01.47"
 * NAME                                S                  X                 PX                  Y                 PY               BETX               BETY               ALFX               ALFY 
 $ %s                                %le                %le                %le                %le                %le                %le                %le                %le                %le 
  "LHCB1$START"                        0   -2.742690723e-05   -6.551460929e-07    7.390359315e-05    5.661291191e-06       0.5499365773       0.5500268277    0.0001306539108   -0.0001491748668
diff --git a/tests/test-cororbit-2/resultb2.ref b/tests/test-cororbit-2/resultb2.ref
index f7f4bb166..33bbebb0f 100644
--- a/tests/test-cororbit-2/resultb2.ref
+++ b/tests/test-cororbit-2/resultb2.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le     3.592259219e-05
-@ DQMIN_PHASE      %le        -2.139583112
+@ DQMIN            %le       0.00048530873
+@ DQMIN_PHASE      %le        0.2153112658
 @ TITLE            %62s "LHC 6.503 with errors and two beam orbit correction using MADX"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.47.07"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "02.01.48"
 * NAME                                S                  X                 PX                  Y                 PY               BETX               BETY               ALFX               ALFY 
 $ %s                                %le                %le                %le                %le                %le                %le                %le                %le                %le 
  "LHCB2$START"                        0    3.932085492e-05   -8.379744547e-07   -5.420823261e-05    2.537128025e-05       0.5500269101       0.5502488679    0.0001853571231    0.0001739722417
diff --git a/tests/test-cororbit-2/test-cororbit-2.ref b/tests/test-cororbit-2/test-cororbit-2.ref
index 981f33173..8eacedb47 100644
--- a/tests/test-cororbit-2/test-cororbit-2.ref
+++ b/tests/test-cororbit-2/test-cororbit-2.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:47:04      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:01:45      +
   ++++++++++++++++++++++++++++++++++++++++++++
 Option,  warn,info,echo;
 
@@ -315,10 +315,10 @@ orbit:   3.018542E-05 -1.061138E-04 -5.422462E-05  2.539827E-05  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    3.544246061e-05 
+                 0                  0                  0    0.0005135178106 
 
        dqmin_phase 
-      -2.010546174 
+      0.3700923528 
 
 
 Coption,print=1;
@@ -400,10 +400,10 @@ orbit:  -2.742691E-05 -6.551461E-07  7.390359E-05  5.661291E-06  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    5.589320539e-05 
+                 0                  0                  0    0.0008807982516 
 
        dqmin_phase 
-   -0.004795216736 
+       1.330576198 
 TWISS, file=resultb2, sequence=lhcb2;
 
 enter Twiss module
@@ -435,10 +435,10 @@ orbit:   3.932085E-05 -8.379745E-07 -5.420823E-05  2.537128E-05  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    3.592259219e-05 
+                 0                  0                  0      0.00048530873 
 
        dqmin_phase 
-      -2.139583112 
+      0.2153112658 
 
 
 removefile, file='fort.61';
diff --git a/tests/test-cororbit-4/result1.file.ref b/tests/test-cororbit-4/result1.file.ref
index 51b2987ca..5a52289c4 100644
--- a/tests/test-cororbit-4/result1.file.ref
+++ b/tests/test-cororbit-4/result1.file.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le     7.140634229e-05
-@ DQMIN_PHASE      %le       -0.2927927246
+@ DQMIN            %le     0.0009816839926
+@ DQMIN_PHASE      %le         1.158423139
 @ TITLE            %51s "LHC 6.5 with errors and orbit correction using MADX"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.47.11"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "02.01.52"
 * NAME                                S                  X                 PX                  Y                 PY               BETX               BETY               ALFX               ALFY 
 $ %s                                %le                %le                %le                %le                %le                %le                %le                %le                %le 
  "LHCB1$START"                        0   -2.464538639e-06   -6.064157593e-06    1.416703348e-06     1.81502452e-06       0.5507483724       0.5494961845    -0.000219161088    0.0008482072954
diff --git a/tests/test-cororbit-4/result2.file.ref b/tests/test-cororbit-4/result2.file.ref
index f5177a2f9..7f1437f6a 100644
--- a/tests/test-cororbit-4/result2.file.ref
+++ b/tests/test-cororbit-4/result2.file.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le     7.521400665e-05
-@ DQMIN_PHASE      %le       -0.2570398035
+@ DQMIN            %le       0.00100091521
+@ DQMIN_PHASE      %le          1.19859319
 @ TITLE            %51s "LHC 6.5 with errors and orbit correction using MADX"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.47.12"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "02.01.53"
 * NAME                                S                  X                 PX                  Y                 PY               BETX               BETY               ALFX               ALFY 
 $ %s                                %le                %le                %le                %le                %le                %le                %le                %le                %le 
  "LHCB1$START"                        0   -0.0005000241726   -1.023773324e-05    3.847989232e-06    0.0001383022072       0.5504990997       0.5495413848   -0.0003925343497     0.000930030752
diff --git a/tests/test-cororbit-4/result3.file.ref b/tests/test-cororbit-4/result3.file.ref
index 161a1e136..4a99a6052 100644
--- a/tests/test-cororbit-4/result3.file.ref
+++ b/tests/test-cororbit-4/result3.file.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le       7.5018411e-05
-@ DQMIN_PHASE      %le       -0.2563681292
+@ DQMIN            %le      0.001001090442
+@ DQMIN_PHASE      %le         1.199507824
 @ TITLE            %51s "LHC 6.5 with errors and orbit correction using MADX"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.47.13"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "02.01.54"
 * NAME                                S                  X                 PX                  Y                 PY               BETX               BETY               ALFX               ALFY 
 $ %s                                %le                %le                %le                %le                %le                %le                %le                %le                %le 
  "LHCB1$START"                        0   -0.0005007148109   -7.334842244e-06    4.787692103e-06    0.0001383022599       0.5506409508       0.5495110803   -0.0003435926903    0.0008276076375
diff --git a/tests/test-cororbit-4/test-cororbit-4.ref b/tests/test-cororbit-4/test-cororbit-4.ref
index a27b583a4..398e51d6e 100644
--- a/tests/test-cororbit-4/test-cororbit-4.ref
+++ b/tests/test-cororbit-4/test-cororbit-4.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:47:07      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:01:48      +
   ++++++++++++++++++++++++++++++++++++++++++++
 Title, "LHC 6.5 with errors and orbit correction using MADX";
 
@@ -123,10 +123,10 @@ orbit:  -5.000008E-04 -2.358324E-09  8.002250E-12  1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    9.717485254e-10 
+                 0                  0                  0    2.083008962e-08 
 
        dqmin_phase 
-      0.3313954679 
+       1.861239221 
 
 
 // Now a machine with the modified bumps as another target orbit 
@@ -175,10 +175,10 @@ orbit:  -5.000008E-04 -2.426804E-09  1.748509E-12  1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    1.019256948e-09 
+                 0                  0                  0    2.131673334e-08 
 
        dqmin_phase 
-      0.2939793082 
+       1.842247831 
 
 
 // Switch off again the bumps and mis-align the machine
@@ -240,10 +240,10 @@ orbit:  -3.439240E-04 -7.343209E-05  2.348868E-04  2.504445E-05  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    5.765135445e-05 
+                 0                  0                  0     0.001928753113 
 
        dqmin_phase 
-       1.939141988 
+      -2.833209211 
 
 
 // Prepare first correction to zero orbit
@@ -2038,10 +2038,10 @@ orbit:  -2.464539E-06 -6.064158E-06  1.416703E-06  1.815025E-06  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    7.140634229e-05 
+                 0                  0                  0    0.0009816839926 
 
        dqmin_phase 
-     -0.2927927246 
+       1.158423139 
 
 
 !******************************************************************
@@ -3813,10 +3813,10 @@ orbit:  -5.000242E-04 -1.023773E-05  3.847989E-06  1.383022E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    7.521400665e-05 
+                 0                  0                  0      0.00100091521 
 
        dqmin_phase 
-     -0.2570398035 
+        1.19859319 
 
 
 !******************************************************************
@@ -5596,10 +5596,10 @@ orbit:  -5.007148E-04 -7.334842E-06  4.787692E-06  1.383023E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0      7.5018411e-05 
+                 0                  0                  0     0.001001090442 
 
        dqmin_phase 
-     -0.2563681292 
+       1.199507824 
 
 
 !******************************************************************
diff --git a/tests/test-cororbit/result.file.ref b/tests/test-cororbit/result.file.ref
index 9eeda5715..f50dfb176 100644
--- a/tests/test-cororbit/result.file.ref
+++ b/tests/test-cororbit/result.file.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le       7.5018411e-05
-@ DQMIN_PHASE      %le       -0.2563681292
+@ DQMIN            %le      0.001001090442
+@ DQMIN_PHASE      %le         1.199507824
 @ TITLE            %51s "LHC 6.5 with errors and orbit correction using MADX"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.47.03"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "02.01.45"
 * NAME                                S                  X                 PX                  Y                 PY               BETX               BETY               ALFX               ALFY 
 $ %s                                %le                %le                %le                %le                %le                %le                %le                %le                %le 
  "LHCB1$START"                        0   -0.0005007148109   -7.334842244e-06    4.787692103e-06    0.0001383022599       0.5506409508       0.5495110803   -0.0003435926903    0.0008276076375
diff --git a/tests/test-cororbit/test-cororbit.ref b/tests/test-cororbit/test-cororbit.ref
index f9809790e..13e807108 100644
--- a/tests/test-cororbit/test-cororbit.ref
+++ b/tests/test-cororbit/test-cororbit.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:46:57      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:01:39      +
   ++++++++++++++++++++++++++++++++++++++++++++
 Option, warn,info,echo;
 
@@ -133,10 +133,10 @@ orbit:  -5.000008E-04 -2.358324E-09  8.002250E-12  1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    9.717485254e-10 
+                 0                  0                  0    2.083008962e-08 
 
        dqmin_phase 
-      0.3313954679 
+       1.861239221 
 !plot,table=my_target1,title="Target orbit 1 x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x;
 
 !plot,table=my_target1,title="Target orbit 1 y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y;
@@ -195,10 +195,10 @@ orbit:  -5.000008E-04 -2.426804E-09  1.748509E-12  1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    1.019256948e-09 
+                 0                  0                  0    2.131673334e-08 
 
        dqmin_phase 
-      0.2939793082 
+       1.842247831 
 !plot,table=my_target2,title="Target orbit 2 x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x;
 
 !plot,table=my_target2,title="Target orbit 2 y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y;
@@ -273,10 +273,10 @@ orbit:  -3.439240E-04 -7.343209E-05  2.348868E-04  2.504445E-05  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    5.765135445e-05 
+                 0                  0                  0     0.001928753113 
 
        dqmin_phase 
-       1.939141988 
+      -2.833209211 
 !plot,table=my_orbit,title="Uncorrected orbit x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x;
 
 !plot,table=my_orbit,title="Uncorrected orbit y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y;
@@ -2090,10 +2090,10 @@ orbit:  -2.464538E-06 -6.064157E-06  1.416704E-06  1.815024E-06  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0     7.14063352e-05 
+                 0                  0                  0    0.0009816839982 
 
        dqmin_phase 
-     -0.2927926408 
+       1.158423147 
 !plot,title="Corrected orbit x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x;
 
 !plot,title="Corrected orbit y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y;
@@ -3906,10 +3906,10 @@ orbit:  -4.984996E-04 -8.661850E-06  4.787576E-06  1.384923E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0     7.54848259e-05 
+                 0                  0                  0     0.001001056456 
 
        dqmin_phase 
-     -0.2572873712 
+       1.198127779 
 !plot,title="Corrected orbit target 1 x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x;
 
 !plot,title="Corrected orbit target 1 y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y;
@@ -5740,10 +5740,10 @@ orbit:  -5.007148E-04 -7.334842E-06  4.787692E-06  1.383023E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0      7.5018411e-05 
+                 0                  0                  0     0.001001090442 
 
        dqmin_phase 
-     -0.2563681292 
+       1.199507824 
 !plot,title="Corrected orbit target 2 x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x;
 
 !plot,title="Corrected orbit target 2 y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y;
diff --git a/tests/test-coupling-dqmin/test-coupling-dqmin.ref b/tests/test-coupling-dqmin/test-coupling-dqmin.ref
index cab848134..5d47f1bd9 100644
--- a/tests/test-coupling-dqmin/test-coupling-dqmin.ref
+++ b/tests/test-coupling-dqmin/test-coupling-dqmin.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 19:08:35      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:07:05      +
   ++++++++++++++++++++++++++++++++++++++++++++
 option, warn,info;
 
@@ -310,10 +310,10 @@ orbit:   5.500000E-04 -1.434121E-10  3.218683E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    7.200055075e-05 
+                 0                  0                  0     0.001018636579 
 
        dqmin_phase 
-       2.358054379 
+       -2.49650859 
 enter Twiss module
   
 iteration:   1 error:   1.641802E-03 deltap:   0.000000E+00
@@ -346,10 +346,10 @@ orbit:   5.500000E-04 -1.434384E-10  3.193826E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0001461743942 
+                 0                  0                  0     0.002037239506 
 
        dqmin_phase 
-       2.355596297 
+      -2.497560175 
 enter Twiss module
   
 iteration:   1 error:   1.641860E-03 deltap:   0.000000E+00
@@ -382,10 +382,10 @@ orbit:   5.500000E-04 -1.434658E-10  3.168943E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0     0.000224585992 
+                 0                  0                  0     0.003055744764 
 
        dqmin_phase 
-       2.351633624 
+      -2.499334653 
 enter Twiss module
   
 iteration:   1 error:   1.641903E-03 deltap:   0.000000E+00
@@ -418,10 +418,10 @@ orbit:   5.500000E-04 -1.434941E-10  3.144044E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0003091121029 
+                 0                  0                  0     0.004074103265 
 
        dqmin_phase 
-       2.346431171 
+      -2.501762235 
 enter Twiss module
   
 iteration:   1 error:   1.641930E-03 deltap:   0.000000E+00
@@ -454,10 +454,10 @@ orbit:   5.500000E-04 -1.435235E-10  3.119125E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0004013840532 
+                 0                  0                  0     0.005092266047 
 
        dqmin_phase 
-       2.340272324 
+      -2.504778966 
 enter Twiss module
   
 iteration:   1 error:   1.641941E-03 deltap:   0.000000E+00
@@ -490,10 +490,10 @@ orbit:   5.500000E-04 -1.435538E-10  3.094175E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0005027715144 
+                 0                  0                  0     0.006110184002 
 
        dqmin_phase 
-       2.333424748 
+      -2.508319301 
 enter Twiss module
   
 iteration:   1 error:   1.641938E-03 deltap:   0.000000E+00
@@ -526,10 +526,10 @@ orbit:   5.500000E-04 -1.435851E-10  3.069207E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0006144016205 
+                 0                  0                  0     0.007127807548 
 
        dqmin_phase 
-       2.326120078 
+      -2.512319968 
 enter Twiss module
   
 iteration:   1 error:   1.641918E-03 deltap:   0.000000E+00
@@ -562,10 +562,10 @@ orbit:   5.500000E-04 -1.436175E-10  3.044220E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0007371611753 
+                 0                  0                  0     0.008145087668 
 
        dqmin_phase 
-       2.318548786 
+        -2.5167195 
 enter Twiss module
   
 iteration:   1 error:   1.641883E-03 deltap:   0.000000E+00
@@ -598,10 +598,10 @@ orbit:   5.500000E-04 -1.436508E-10  3.019210E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0008717629271 
+                 0                  0                  0       0.0091619744 
 
        dqmin_phase 
-       2.310853251 
+      -2.521463917 
 enter Twiss module
   
 iteration:   1 error:   1.641832E-03 deltap:   0.000000E+00
@@ -634,10 +634,10 @@ orbit:   5.500000E-04 -1.436851E-10  2.994170E-12 -1.600000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0      0.00101875451 
+                 0                  0                  0      0.01017841857 
 
        dqmin_phase 
-       2.303136022 
+       -2.52650435 
 
   Number of warnings: 233
 233 in C and 0 in Fortran
diff --git a/tests/test-dynap/test-dynap.ref b/tests/test-dynap/test-dynap.ref
index cc66a4a8e..b7ffe4acb 100644
--- a/tests/test-dynap/test-dynap.ref
+++ b/tests/test-dynap/test-dynap.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:47:20      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 05:20:37      +
   ++++++++++++++++++++++++++++++++++++++++++++
 Option, -echo,-info,-warn;
 
@@ -85,10 +85,10 @@ orbit:   5.000000E-04 -5.185248E-14 -8.988607E-15 -1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    3.989424543e-14 
+                 0                  0                  0    4.056751349e-13 
 
        dqmin_phase 
-      -2.073669114 
+    -0.04229404689 
 assign,echo="temp.bb.install",truncate;
 
 
@@ -975,10 +975,10 @@ orbit:  -5.264405E-13  2.081183E-15 -8.137851E-13  9.047770E-15  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    3.040369735e-14 
+                 0                  0                  0    4.180333957e-13 
 
        dqmin_phase 
-        1.98631543 
+       3.113732537 
 !--- separation for halo collisions at IP2
 
 on_sep2 = 2.118 * sqrt(epsx * r2ip2->betx) / 0.0007999979093;
@@ -2868,22 +2868,22 @@ orbit:  -4.999994E-04  5.687249E-10 -4.737471E-10  1.424999E-04  0.000000E+00  0
   end dynap 
 endtrack;
 
-sec.s since start: 15   since last call: 11
+sec.s since start: 16   since last call: 12
 exit TRACK module
 
 write,table=dynap,file;
 
-sec.s since start: 15   since last call: 0
+sec.s since start: 16   since last call: 0
 write,table=dynaptune,file;
 
-sec.s since start: 15   since last call: 0
+sec.s since start: 16   since last call: 0
 !system,"foot < dynaptune > footprint";
 
 !stop;
 
 
   Number of warnings: 0
-sec.s since start: 15   since last call: 0
+sec.s since start: 16   since last call: 0
 
   ++++++++++++++++++++++++++++++++++++++++++++
   +          MAD-X finished normally         +
diff --git a/tests/test-dynap/twiss-table-2.ref b/tests/test-dynap/twiss-table-2.ref
index 1515b7fe9..791723016 100644
--- a/tests/test-dynap/twiss-table-2.ref
+++ b/tests/test-dynap/twiss-table-2.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le     3.989424543e-14
-@ DQMIN_PHASE      %le        -2.073669114
+@ DQMIN            %le     4.056751349e-13
+@ DQMIN_PHASE      %le      -0.04229404689
 @ TITLE            %08s "no-title"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.47.23"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "05.34.41"
 * NAME                                X                  Y               BETX               BETY 
 $ %s                                %le                %le                %le                %le 
  "LHCB2$START"                   0.0005   -8.988606552e-15               0.55               0.55
diff --git a/tests/test-emit-2/test-emit-2.ref b/tests/test-emit-2/test-emit-2.ref
index 9251d08c2..754a6214a 100644
--- a/tests/test-emit-2/test-emit-2.ref
+++ b/tests/test-emit-2/test-emit-2.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:47:14      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:01:55      +
   ++++++++++++++++++++++++++++++++++++++++++++
 Beam, SEQUENCE=Machine, PARTICLE=electron, energy=3, RADIATE=True;
 
@@ -253,10 +253,10 @@ orbit:   8.623892E-10 -1.527012E-07 -2.720436E-20  3.363084E-21 -2.156963E-03 -2
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    1.657534224e-16 
+                 0                  0                  0    3.269439703e-16 
 
        dqmin_phase 
-      0.3790454771 
+      0.6688803693 
 Emit, DELTAP=0.0 ;
 
 enter EMIT module
@@ -385,10 +385,10 @@ orbit:   6.815788E-10 -1.536905E-07 -1.075601E-20 -1.724984E-21 -2.156961E-03 -2
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    3.866283594e-16 
+                 0                  0                  0    2.007956874e-16 
 
        dqmin_phase 
-       -3.04230137 
+       2.338605231 
 
 
 stop;
diff --git a/tests/test-makethin-4/test-makethin-4.ref b/tests/test-makethin-4/test-makethin-4.ref
index f6978e676..421f866da 100644
--- a/tests/test-makethin-4/test-makethin-4.ref
+++ b/tests/test-makethin-4/test-makethin-4.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:45:51      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:00:37      +
   ++++++++++++++++++++++++++++++++++++++++++++
 ! H. Burkhardt.  Updated for improved makethin select in summer 2005
 
@@ -98,10 +98,10 @@ orbit:   0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    0.0004848535621 
+                 0                  0                  0      0.01131772694 
 
        dqmin_phase 
-       3.053104081 
+      -1.658929225 
 save,sequence=fivecell,file="fivecell_thin_options.seq";
 
 ++++++ warning: SAVE makes all previous USE invalid !  
diff --git a/tests/test-match-5/test-match-5.ref b/tests/test-match-5/test-match-5.ref
index b48cf851f..2a2d72d04 100644
--- a/tests/test-match-5/test-match-5.ref
+++ b/tests/test-match-5/test-match-5.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.07.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2021.05.03               +
-  + Execution date: 2021.12.10 13:04:22      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 05:21:25      +
   ++++++++++++++++++++++++++++++++++++++++++++
 TITLE,'Global tune matching with MAD-X';
 
diff --git a/tests/test-match-6/test-match-6.ref b/tests/test-match-6/test-match-6.ref
index 714ed788a..36c71e268 100644
--- a/tests/test-match-6/test-match-6.ref
+++ b/tests/test-match-6/test-match-6.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:48:09      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:02:45      +
   ++++++++++++++++++++++++++++++++++++++++++++
 !---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|---8;
 
@@ -149,10 +149,10 @@ orbit:   5.000020E-04  4.645554E-09  1.227190E-12 -1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    1.451133019e-09 
+                 0                  0                  0    1.898509437e-08 
 
        dqmin_phase 
-      -0.497154204 
+       1.021916474 
 
 
 ! Match the chromaticity:
@@ -265,10 +265,10 @@ orbit:  -5.000008E-04 -2.358324E-09  8.002249E-12  1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    9.717344517e-10 
+                 0                  0                  0     2.08298973e-08 
 
        dqmin_phase 
-      0.3313970945 
+       1.861242389 
 
 
 ! Generate a TWISS table:
@@ -311,10 +311,10 @@ orbit:   5.000020E-04  4.645554E-09  1.227189E-12 -1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    1.451133498e-09 
+                 0                  0                  0    1.898507491e-08 
 
        dqmin_phase 
-     -0.4971537847 
+       1.021915312 
 
 
 stop;
diff --git a/tests/test-match-6/twiss.b2.data.ref b/tests/test-match-6/twiss.b2.data.ref
index 020525df5..9843c8a70 100644
--- a/tests/test-match-6/twiss.b2.data.ref
+++ b/tests/test-match-6/twiss.b2.data.ref
@@ -42,12 +42,12 @@
 @ SYNCH_5          %le                   0
 @ SYNCH_6          %le                   0
 @ SYNCH_8          %le                   0
-@ DQMIN            %le     1.451133498e-09
-@ DQMIN_PHASE      %le       -0.4971537847
+@ DQMIN            %le     1.898507491e-08
+@ DQMIN_PHASE      %le         1.021915312
 @ TITLE            %74s "Matching chromaticity for beam1 and beam2 of the LHC 6.4 lattice with MADX"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.48.16"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "05.21.33"
 * NAME                                S               BETX               BETY 
 $ %s                                %le                %le                %le 
  "IP1"                                0       0.5499995661       0.5500000588
diff --git a/tests/test-match-7/test-match-7.ref b/tests/test-match-7/test-match-7.ref
index acf9a9d53..1137b8ee9 100644
--- a/tests/test-match-7/test-match-7.ref
+++ b/tests/test-match-7/test-match-7.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:48:17      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:02:52      +
   ++++++++++++++++++++++++++++++++++++++++++++
 !---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|---8;
 
@@ -259,10 +259,10 @@ orbit:  -5.000010E-04 -2.693609E-09  8.054967E-12  1.425000E-04  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    2.886591961e-09 
+                 0                  0                  0    2.078547946e-08 
 
        dqmin_phase 
-      0.2543075681 
+       1.733653891 
 
 
 stop;
diff --git a/tests/test-plot-2/test-plot-2.ref b/tests/test-plot-2/test-plot-2.ref
index 17891e877..0dd413a75 100755
--- a/tests/test-plot-2/test-plot-2.ref
+++ b/tests/test-plot-2/test-plot-2.ref
@@ -419,10 +419,10 @@ orbit:  -1.830396E-07  4.958385E-08 -3.528003E-04 -1.117477E-04 -8.237754E-07  4
        1.526297364       0.3728165258       0.5042000195        4.147876677 
 
            synch_6            synch_8             nflips              dqmin 
-       60.59368277        330.6335677                  0    4.310788592e-05 
+       60.59368277        330.6335677                  0     0.000352946688 
 
        dqmin_phase 
-      -3.029647811 
+      -2.615818262
 
 
 plot, haxis=s, vaxis=y, interpolate, range=QFN12/XFW11, noversion, hmin=10.5,hmax=14.0,
diff --git a/tests/test-ptc-normal-5D-beambeam/leir.summ.twiss.ref b/tests/test-ptc-normal-5D-beambeam/leir.summ.twiss.ref
index 2411d7bc3..fbae70c38 100644
--- a/tests/test-ptc-normal-5D-beambeam/leir.summ.twiss.ref
+++ b/tests/test-ptc-normal-5D-beambeam/leir.summ.twiss.ref
@@ -1,9 +1,9 @@
 @ NAME             %04s "SUMM"
 @ TYPE             %04s "SUMM"
 @ TITLE            %08s "no-title"
-@ ORIGIN           %16s "5.08.00 Linux 64"
-@ DATE             %08s "27/01/22"
-@ TIME             %08s "20.51.03"
+@ ORIGIN           %16s "5.08.01 Linux 64"
+@ DATE             %08s "10/08/22"
+@ TIME             %08s "02.05.33"
 *             LENGTH             ORBIT5               ALFA            GAMMATR                 Q1                DQ1            BETXMAX              DXMAX              DXRMS             XCOMAX             XCORMS                 Q2                DQ2            BETYMAX              DYMAX              DYRMS             YCOMAX             YCORMS             DELTAP            SYNCH_1            SYNCH_2            SYNCH_3            SYNCH_4            SYNCH_5            SYNCH_6            SYNCH_8             NFLIPS              DQMIN        DQMIN_PHASE 
 $                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le                %le 
-        78.54370266                 -0       0.1182846608        2.907607534        1.822284779         320.934062        15.17476941        20.95013348        9.843308596                  0                  0         2.71778368       -407.6666827        20.33402763        5.142031844        2.210404775                  0                  0                  0        9.290534968        1.526297364       0.3728165258        0.480816357        4.297209132        52.84960067        260.4580979                  0     0.001427098642      -0.1606260792
+        78.54370266                 -0       0.1182846608        2.907607534        1.822284779         320.934062        15.17476941        20.95013348        9.843308596                  0                  0         2.71778368       -407.6666827        20.33402763        5.142031844        2.210404775                  0                  0                  0        9.290534968        1.526297364       0.3728165258        0.480816357        4.297209132        52.84960067        260.4580979                  0      0.03009364944        1.784097737
diff --git a/tests/test-ptc-normal-5D-beambeam/test-ptc-normal-5D-beambeam.ref b/tests/test-ptc-normal-5D-beambeam/test-ptc-normal-5D-beambeam.ref
index 3de384e32..a0d3f7a93 100644
--- a/tests/test-ptc-normal-5D-beambeam/test-ptc-normal-5D-beambeam.ref
+++ b/tests/test-ptc-normal-5D-beambeam/test-ptc-normal-5D-beambeam.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:51:03      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 05:24:18      +
   ++++++++++++++++++++++++++++++++++++++++++++
 !identical to test-ptc-normal-5D so beam-beam effect can be compared directly
 
@@ -863,10 +863,10 @@ orbit:   0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00  0
        1.526297364       0.3728165258        0.480816357        4.297209132 
 
            synch_6            synch_8             nflips              dqmin 
-       52.84960067        260.4580979                  0     0.001427098642 
+       52.84960067        260.4580979                  0      0.03009364944 
 
        dqmin_phase 
-     -0.1606260792 
+       1.784097737 
 
 
 write, table=summ, file="leir.summ.twiss";
diff --git a/tests/test-touschek-2/test-touschek-2.ref b/tests/test-touschek-2/test-touschek-2.ref
index 08a6d8f5c..7b30b4270 100644
--- a/tests/test-touschek-2/test-touschek-2.ref
+++ b/tests/test-touschek-2/test-touschek-2.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:52:15      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:06:42      +
   ++++++++++++++++++++++++++++++++++++++++++++
 Option, warn,info,echo;
 
@@ -104,10 +104,10 @@ orbit:  -1.311603E-08 -2.518183E-10  2.083286E-08  1.699982E-04  9.252419E-06  1
     0.002244883795     7.99769003e-07    1.090641769e-06    2.114259331e-08 
 
            synch_6            synch_8             nflips              dqmin 
-       13.80516467       0.2515673143                  0    1.740876454e-08 
+       13.80516467       0.2515673143                  0    1.027807447e-07 
 
        dqmin_phase 
-      0.2179434512 
+       1.750906723 
 
 
 ! reduce size of output table:
@@ -226,10 +226,10 @@ orbit:  -1.311603E-08 -2.518183E-10  2.083286E-08  1.699982E-04  9.252419E-06  1
     0.002244883795     7.99769003e-07    1.090641769e-06    2.114259331e-08 
 
            synch_6            synch_8             nflips              dqmin 
-       13.80516467       0.2515673143                  0    1.739970087e-08 
+       13.80516467       0.2515673143                  0    1.027566353e-07 
 
        dqmin_phase 
-      0.2165767697 
+       1.750986293 
 
 
 select, flag=touschek, column= name, S, TLI, TLIW, TLITOT;
diff --git a/tests/test-twiss-6/test-twiss-6.ref b/tests/test-twiss-6/test-twiss-6.ref
index 13d79e38a..e32827c55 100644
--- a/tests/test-twiss-6/test-twiss-6.ref
+++ b/tests/test-twiss-6/test-twiss-6.ref
@@ -1,9 +1,9 @@
 
   ++++++++++++++++++++++++++++++++++++++++++++
-  +     MAD-X 5.08.00  (64 bit, Linux)       +
+  +     MAD-X 5.08.01  (64 bit, Linux)       +
   + Support: mad@cern.ch, http://cern.ch/mad +
-  + Release   date: 2022.01.13               +
-  + Execution date: 2022.01.27 20:46:51      +
+  + Release   date: 2022.02.25               +
+  + Execution date: 2022.08.10 02:01:33      +
   ++++++++++++++++++++++++++++++++++++++++++++
 ! Threader example
 
@@ -163,10 +163,10 @@ orbit:   2.578233E-03  3.848899E-05 -2.257435E-08 -3.834450E-10  0.000000E+00  0
                  0                  0                  0                  0 
 
            synch_6            synch_8             nflips              dqmin 
-                 0                  0                  0    1.542093924e-08 
+                 0                  0                  0    3.212198129e-08 
 
        dqmin_phase 
-      -2.880884588 
+       2.087392919 
 
   Number of warnings: 0
 
