       return
 
     fs.stat target, (newErr, newStat) ->
-      if newErr and newErr.code == 'ENOENT'
+      if newErr and newErr.code is 'ENOENT'
         callback(undefined, true) # new path does not exist so it is valid
         return
 

  oldStat = statSyncNoException(source)
  newStat = statSyncNoException(target)

  if oldStat is false or newStat is false
    return true

  # New path exists so check if it points to the same file as the initial
  # path to see if the case of the file name is being changed on a case

        callback(isMoveTargetValidErr)
        return

      unless isTargetValid
        error = new Error("'#{target}' already exists.")
        error.code = 'EEXIST'
        callback(error)
