           if stats.isDirectory()
             fs.readdir source, (err, files) ->
               throw err if err
-              trackUnprocessedFiles sourceIndex, files.length
-              for file in files
-                compile path.join(source, file), sourceIndex
-              trackCompleteFiles sourceIndex, 1
+              files = files.map (file) -> path.join source, file
+              index = sources.indexOf source
+              sources[index..index] = files
+              sourceCode[index..index] = files.map -> null
+              compile file for file in files
           else if topLevel or path.extname(source) is '.coffee'
             fs.readFile source, (err, code) ->
               throw err if err
-              if opts.join
-                contents[sourceIndex] = helpers.compact([contents[sourceIndex], code.toString()]).join('\n')
-              else
-                compileScript(source, code.toString(), base)
-              trackCompleteFiles sourceIndex, 1
-            watch source, base if opts.watch and not opts.join
+              compileScript(source, code.toString(), base)
+            watch source, base if opts.watch
           else
-            trackCompleteFiles sourceIndex, 1
-    compile source, sources.indexOf(source), true
+            index = sources.indexOf source
+            sources.splice index, 1
+            sourceCode.splice index, 1
+            
+    compile source, true
 
 # Compile a single source script, containing the given code, according to the
 # requested options. If evaluating the script directly sets `__filename`,

  stdin.on 'end', ->
    compileScript null, code

# After all of the source files are done being read, concatenate and compile
# them together.
compileJoin = ->
  code = contents.join '\n'
  compileScript opts.join, code, opts.join

# Load files that are to-be-required before compilation occurs.
loadRequires = ->

# compile them. If a directory is passed, recursively compile all
# '.coffee' extension source files in it and all subdirectories.
compileScripts = ->
        
  for source, index in sources
    sourceCode[index] = null
    
    base = path.join source
    
    compile = (source, topLevel) ->
      path.exists source, (exists) ->
        if topLevel and not exists and source[-7..] isnt '.coffee'
          source = sources[sources.indexOf(source)] = "#{source}.coffee"
          return compile source, topLevel
        if topLevel and not exists 
          console.error "File not found: #{source}"
          process.exit 1
