     fs.writeFile filePath, JSON.stringify(manifest, null, 2),
       encoding: 'utf-8'
     , callback
+    return
 
   readCache: (loader, options, callback) ->
     options.discover = false
     manifest.load.load loader.baseDir, options, callback
+    return
 
   prepareManifestOptions: (loader) ->
     loader.options = {} unless loader.options

  CoffeeScript.register()

registerCustomLoaders = (loader, componentLoaders, callback) ->
  return callback null unless componentLoaders.length
  customLoader = require componentLoaders.shift()
  loader.registerLoader customLoader, (err) ->
    return callback err if err
    registerCustomLoaders loader, componentLoaders, callback

registerModules = (loader, modules, callback) ->
  compatible = modules.filter (m) -> m.runtime in ['noflo', 'noflo-nodejs']

    options.runtimes.push 'noflo' if options.runtimes.indexOf('noflo') is -1
    options.recursive = if typeof loader.options.recursive is 'undefined' then true else loader.options.recursive
    options.manifest = loader.options.manifest or 'fbp.json'
    return options

  listComponents: (loader, manifestOptions, callback) ->
    @readCache loader, manifestOptions, (err, manifest) =>
      if err
        unless loader.options.discover
          callback err 
          return
        dynamicLoader.listComponents loader, manifestOptions, (err, modules) =>
          if err
            callback err
            return
          @writeCache loader, manifestOptions,
            version: 1
            modules: modules
          , (err) ->
            if err
              callback err
              return
            callback null, modules
            return
        return
      registerModules loader, manifest.modules, (err) ->
        if err
          callback err
          return
        callback null, manifest.modules
        return
      return
    return

dynamicLoader =
  listComponents: (loader, manifestOptions, callback) ->
    manifestOptions.discover = true
    manifest.list.list loader.baseDir, manifestOptions, (err, modules) =>
      if err
        callback err
        return
      registerModules loader, modules, (err) ->
        if err
          callback err
          return
        callback null, modules
        return
      return
    return

registerSubgraph = (loader) ->
  # Inject subgraph component
