anchor.diff:    real(kind=fPrec), intent(in)  :: cOffset
     integer,          intent(out) :: sliceID
   
  -  type(type_collParams), allocatable :: collTmp(:)
  +  type(type_sliceParams), allocatable :: collTmp(:)
     real(kind=fPrec) sX(nSlices+1), sX1(nSlices+1), sX2(nSlices+1), sY1(nSlices+1), sY2(nSlices+1)
     real(kind=fPrec) angle1(nSlices), angle2(nSlices)
     real(kind=fPrec) fac1(6), fac2(6), scale1, scale2, maxY
     real(kind=fPrec) fitData(2,nSlices+1), fitTilt(2,nSlices)
     integer i
   
  -  if(allocated(jaw_collData)) then
  -    allocate(collTmp(jaw_nCollData+1))
  -    collTmp(1:jaw_nCollData) = jaw_collData(1:jaw_nCollData)
  -    call move_alloc(collTmp, jaw_collData)
  -    jaw_nCollData = jaw_nCollData + 1
  -  else
  -    allocate(jaw_collData(1))
  -    jaw_nCollData = 1
  +  if(allocated(jaw_sliceData)) then
  +    allocate(collTmp(jaw_nSliceData+1))
  +    collTmp(1:jaw_nSliceData) = jaw_sliceData(1:jaw_nSliceData)
  +    call move_alloc(collTmp, jaw_sliceData)
  +    jaw_nSliceData = jaw_nSliceData + 1
  +  else
  +    allocate(jaw_sliceData(1))
  +    jaw_nSliceData = 1
     end if
   
     fac1   = jaw_fitData(fitID(1))%fitParams
  
positive.code: ! ================================================================================================ !
  integer function jaw_getSliceCount(sliceID)
    integer, intent(in) :: sliceID
    jaw_getSliceCount = jaw_collData(sliceID)%nSlices
  end function jaw_getSliceCount
  
  end module coll_jawfit
  
negative.code:     logical                       :: reCentre     = .false. ! Recentre the collimator to new minimum
    end type type_fitParams
  
    type, private :: type_sliceParams
      integer                       :: nSlices      = 0       ! The number of slices
      real(kind=fPrec)              :: fitLength    = zero    ! Slice length
      real(kind=fPrec), allocatable :: fitData(:,:)           ! Slice data
      real(kind=fPrec), allocatable :: fitTilt(:,:)           ! Slice tilt
    end type type_sliceParams
  
    type(type_fitParams),  allocatable, private, save :: jaw_fitData(:)  ! List of jaw fit parameters
    type(type_sliceParams), allocatable, private, save :: jaw_sliceData(:) ! List of collimator fit slices
    integer,                            private, save :: jaw_nFitData  = 0  ! Count of jaw_fitData
    integer,                            private, save :: jaw_nSliceData = 0  ! Count of jaw_sliceData
  
  contains
  
  