anchor.diff:                 DestMesh%ElemTable(i)%maxelem = SrcMesh%ElemTable(i)%maxelem
                  DestMesh%ElemTable(i)%XElement = SrcMesh%ElemTable(i)%XElement
   
  -               ALLOCATE(DestMesh%ElemTable(i)%Elements(DestMesh%ElemTable(i)%maxelem),STAT=ErrStat)
  -               IF (ErrStat /=0) THEN
  +               ALLOCATE(DestMesh%ElemTable(i)%Elements(DestMesh%ElemTable(i)%maxelem),STAT=ErrStat2)
  +               IF (ErrStat2 /=0) THEN
                     ErrStat = ErrID_Fatal
                     ErrMess=' MeshCopy: Error allocating ElemTable%Elements.'
                     RETURN !Early return
  
positive.code:          IF ( SrcMesh%nNodes .NE. DestMesh%nNodes ) THEN
              ErrStat = ErrID_Fatal
              ErrMess = "MeshCopy:MESH_UPDATEREFERENCE of meshes with different numbers of nodes."
           ENDIF         ! if we have a different number of nodes or different element connectivity, we'll have to redo this
           
           DestMesh%Position       = SrcMesh%Position
  
negative.code:          IF ( SrcMesh%nNodes .NE. DestMesh%nNodes ) THEN
              ErrStat = ErrID_Fatal
              ErrMess = "MeshCopy: MESH_UPDATECOPY of meshes with different numbers of nodes."
              RETURN
           ENDIF
                    
        ELSE IF ( CtrlCode .EQ. MESH_UPDATEREFERENCE ) THEN
  