anchor.diff:        CALL GetNewUnit( unOut, ErrStat2, ErrMsg2 )      
         CALL OpenBOutFile ( unOut, FileName, ErrStat2, ErrMsg2)
            CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  -         IF (ErrStat >= AbortErrLev ) RETURN
  +         if (ErrStat >= AbortErrLev ) then
  +            call cleanup()
  +            IF (.NOT. PRESENT(Unit)) THEN
  +               CLOSE(unOut)
  +               unOut = -1
  +            END IF
  +                        
  +            RETURN
  +         end if
     
            ! checkpoint file header:
         WRITE (unOut, IOSTAT=ErrStat2)   INT(ReKi              ,B4Ki)     ! let's make sure we've got the correct number of bytes for reals on restart.
  
positive.code:       ! Get the arrays of data to be stored in the output file
     CALL FAST_PackTurbineType( ReKiBuf, DbKiBuf, IntKiBuf, Turbine, ErrStat2, ErrMsg2 )
        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
        IF (ErrStat >= AbortErrLev ) RETURN
        
     ArraySizes = 0   
     IF ( ALLOCATED(ReKiBuf)  ) ArraySizes(1) = SIZE(ReKiBuf)
  
negative.code:    
     END IF
        
        ! in case the Turbine data structure isn't empty on entry of this routine:
     call FAST_DestroyTurbineType( Turbine, ErrStat2, ErrMsg2 )   
     
        ! data from current time step:
     READ (unIn, IOSTAT=ErrStat2)   ArraySizes                       ! Number of reals, doubles, and integers written to file
     
  