anchor.diff:          else ! Reading physical coordinates
             if(fma_norm_flag(i) == 1 ) then
               ! Have a matrix that's not zero (i.e. did we put a 6d LINE block?)
  -            if(dumptas(j,1,1) == zero .and. dumptas(j,1,2) == zero .and. &
  -                dumptas(j,1,3) == zero .and. dumptas(j,1,4) == zero) then
  +            if(dumptas(1,1) == zero .and. dumptas(1,2) == zero .and. &
  +               dumptas(1,3) == zero .and. dumptas(1,4) == zero) then
                 write(lerr,"(a)") "FMA> ERROR The normalisation matrix appears to not be set? Did you forget to put a 6D LINE block?"
                 call prror
               end if
  
positive.code: 
                ! remove closed orbit -> check units used in dumpclo (is x' or px used?)
                do m=1,6
                  xyzvdummy2(m)=xyzvdummy(m)-dumpclo(j,m)
                end do
  
                ! For use in with normalised coordinates: convert to canonical variables
                xyzvdummy2(2)=xyzvdummy2(2) * ((one+xyzvdummy2(6))+dumpclo(j,6))
                xyzvdummy2(4)=xyzvdummy2(4) * ((one+xyzvdummy2(6))+dumpclo(j,6))
  
                ! Normalise nxyz=dumptasinv*xyz2
                do m=1,6
                  nxyzvdummy(m)=zero
                  do n=1,6
                    nxyzvdummy(m)=nxyzvdummy(m) + dumptasinv(j,m,n)*xyzvdummy2(n)
                  end do
                  ! convert nxyzvdummy(6) to 1.e-3 sqrt(m)
                  ! unit: nx,npx,ny,npy,nsig,ndelta all in [1.e-3 sqrt(m)]
  
negative.code:           ! - write closed orbit in header of file with normalised phase space coordinates (tmpUnit)
            !   units: x,xp,y,yp,sig,dp/p = [mm,mrad,mm,mrad,1] (note: units are already changed in linopt part)
            write(tmpUnit,"(a,1x,6(1x,1pe16.9))") "# closorb", &
              dumpclo(1),dumpclo(2),dumpclo(3), &
              dumpclo(4),dumpclo(5),dumpclo(6)
  
            ! - write tas-matrix and its inverse in header of file with normalised phase space coordinates (tmpUnit)
            !   units: x,px,y,py,sig,dp/p [mm,mrad,mm,mrad,1]
            write(tmpUnit,"(a,1x,36(1x,1pe16.9))") "# tamatrix [mm,mrad,mm,mrad,1]", &
              dumptas(1,1),dumptas(1,2),dumptas(1,3),dumptas(1,4), &
              dumptas(1,5),dumptas(1,6),dumptas(2,1),dumptas(2,2), &
              dumptas(2,3),dumptas(2,4),dumptas(2,5),dumptas(2,6), &
              dumptas(3,1),dumptas(3,2),dumptas(3,3),dumptas(3,4), &
              dumptas(3,5),dumptas(3,6),dumptas(4,1),dumptas(4,2), &
              dumptas(4,3),dumptas(4,4),dumptas(4,5),dumptas(4,6), &
              dumptas(5,1),dumptas(5,2),dumptas(5,3),dumptas(5,4), &
              dumptas(5,5),dumptas(5,6),dumptas(6,1),dumptas(6,2), &
              dumptas(6,3),dumptas(6,4),dumptas(6,5),dumptas(6,6)
  
            write(tmpUnit,"(a,1x,36(1x,1pe16.9))") "# inv(tamatrix)", &
              dumptasinv(1,1),dumptasinv(1,2),dumptasinv(1,3), &
              dumptasinv(1,4),dumptasinv(1,5),dumptasinv(1,6), &
              dumptasinv(2,1),dumptasinv(2,2),dumptasinv(2,3), &
              dumptasinv(2,4),dumptasinv(2,5),dumptasinv(2,6), &
              dumptasinv(3,1),dumptasinv(3,2),dumptasinv(3,3), &
              dumptasinv(3,4),dumptasinv(3,5),dumptasinv(3,6), &
              dumptasinv(4,1),dumptasinv(4,2),dumptasinv(4,3), &
              dumptasinv(4,4),dumptasinv(4,5),dumptasinv(4,6), &
              dumptasinv(5,1),dumptasinv(5,2),dumptasinv(5,3), &
              dumptasinv(5,4),dumptasinv(5,5),dumptasinv(5,6), &
              dumptasinv(6,1),dumptasinv(6,2),dumptasinv(6,3), &
              dumptasinv(6,4),dumptasinv(6,5),dumptasinv(6,6)
  
            write(tmpUnit,"(a)") "# id turn pos[m] nx[1.e-3 sqrt(m)] npx[1.e-3 sqrt(m)] ny[1.e-3 sqrt(m)] "//&
              "npy[1.e-3 sqrt(m)] nsig[1.e-3 sqrt(m)] ndp/p[1.e-3 sqrt(m)] kt"
  