anchor.diff:  
       ! delete the temporary input arrays/meshes 
       CALL MAP_DestroyInput( u_interp, ErrStat, ErrMsg )      
  -    !@Marco: make sure that this is destroyed on early return, above.
   
     END SUBROUTINE MAP_UpdateStates                                                                !   -------+
     !==========================================================================================================
  
positive.code:        RETURN
      END IF
  
      CALL MAP_F2C_CopyParam( p, ErrStat, ErrMsg ) 
      IF (ErrStat .NE. ErrID_None ) THEN
         CALL MAP_CheckError("FAST/MAP F2C parameter state conversion error.",ErrMSg)
         RETURN
      END IF
  
      CALL MAP_F2C_CopyContState( x, ErrStat, ErrMsg ) 
      IF (ErrStat .NE. ErrID_None ) THEN
  
negative.code:     CHARACTER(*)                    , INTENT(  OUT) :: ErrMsg     ! Error message if ErrStat /= ErrID_None
  
      ! Local variables
      INTEGER(KIND=C_INT)                             :: status_from_MAP 
      CHARACTER(KIND=C_CHAR,len=1024)                 :: message_from_MAP
      REAL(KIND=C_FLOAT)                              :: time 
      INTEGER(KIND=C_INT)                             :: interval 
      INTEGER(IntKi)                                  :: i
      TYPE(MAP_InputType)                             :: u_interp    ! Inputs at t
      INTEGER(IntKi)                                  :: ErrStat2    ! Error status of the operation
      CHARACTER(LEN(ErrMsg))                          :: ErrMsg2     ! Error message if ErrStat /= ErrID_None
  
      
      status_from_MAP = 0
      message_from_MAP = ""//CHAR(0)
      i=0
      ! set the time and coupling interval to something readable by MAP (using KIND=C_INT/C_FLOAT instead
      ! of the native IntKi/DbKi format in FAST)
      time = t
      interval = n
      
      ! create space for arrays/meshes in u_interp
      CALL MAP_CopyInput( u(1), u_interp, MESH_NEWCOPY, ErrStat, ErrMsg )      
      IF (ErrStat .NE. ErrID_None ) THEN
         CALL MAP_CheckError("FAST/MAP Mesh copy failed in MAP_UpdateStates().",ErrMSg)
         CALL MAP_DestroyInput( u_interp, ErrStat2, ErrMsg2 )
         RETURN
      END IF
  
              
      CALL MAP_Input_ExtrapInterp(u, utimes, u_interp, t + p%dt, ErrStat, ErrMsg)
      IF (ErrStat .NE. ErrID_None ) THEN
         CALL MAP_CheckError("FAST/MAP Mesh extrapolation failed in MAP_UpdateStates().",ErrMSg)
         CALL MAP_DestroyInput( u_interp, ErrStat2, ErrMsg2 )
         RETURN
      END IF
      
      ! Copy the mesh input to the MAP C types
      DO i = 1,u_interp%PtFairleadDisplacement%NNodes
         u_interp%X(i) = u_interp%PtFairleadDisplacement%Position(1,i) + u_interp%PtFairleadDisplacement%TranslationDisp(1,i)
  