anchor.diff:        el_type=kz(ii)      ! type found
   
         if(ldoubleElement) then ! Sanity check
  -        write(lout,*) "DYNK> ERROR Two elements with the same BEZ"
  +        write(lout,"(a)") "DYNK> ERROR Two elements with the same BEZ"
           call prror(-1)
         end if
         ldoubleElement = .true.
   
         select case(abs(el_type))
  -        
  +
         case(1,2,3,4,5,6,7,8,9,10)
           ! horizontal bending kick, quadrupole kick, sextupole kick, octupole kick, decapole kick,
           ! dodecapole kick, 14th pole kick, 16th pole kick, 18th pole kick,20th pole kick
  -
           if(att_name == "average_ms") then
             ed(ii) = newValue
           else
             goto 100 ! ERROR
           end if
           call initialize_element(ii, .false.)
  -  
  +
         case(11)
  -        im=irm(ii)
  -        if(att_name=="scaleall") then
  -          scalemu(im) = newValue 
  +        im = irm(ii)
  +        if(att_name == "scaleall") then
  +          scalemu(im) = newValue
           else if(att_name(1:1) == "a" .or. att_name(1:1) == "b") then
  -          if(LEN_TRIM(att_name) .eq. 5) then
  +          if(len_trim(att_name) == 5) then
               range = 3
               call chr_cast(att_name(2:2), orderMult, iErr)
  -          else if(LEN_TRIM(att_name) .eq. 6) then
  +          else if(len_trim(att_name) == 6) then
               call chr_cast(att_name(2:3), orderMult, iErr)
               range = 4
             else
               goto 100
  -          endif
  +          end if
             if(iErr) goto 100
  -          if(nmu(ii) .lt. orderMult) then
  +          if(nmu(ii) < orderMult) then
               nmu(ii) = orderMult
  -          endif
  -          
  -          r0 = r00(im)
  +          end if
  +
  +          r0  = r00(im)
             r0a = one
             do k=2,orderMult
  -            r0a=r0a*r0
  +            r0a = r0a*r0
             end do
             if(att_name(1:1) == "a" .and. att_name(range:range+3) == "rms") then
               aka(im,orderMult) = newValue*benkc(im)/r0a
  
positive.code:       case(11)
          im=irm(ii)
          if(att_name=="scaleall") then
            dynk_getvalue = scalemu(im) 
          else if(att_name(1:1) == "a" .or. att_name(1:1) == "b") then
            if(LEN_TRIM(att_name) .eq. 5) then
               range = 3
  
negative.code:             ak0(im,orderMult) = newValue*benkc(im)/r0a
            else if(att_name(1:1) == "b" .and. att_name(range:range+3) == "str") then
              bk0(im,orderMult) = newValue*benkc(im)/r0a
            else
              goto 100 ! ERROR
            end if
          end if
          call initialize_element(ii, .false.)
  
        case(12)
          if(att_name == "voltage") then ! [MV]
            ed(ii) = newValue
  