   end
 
   # Wait for messages from child processes
-  defp wait_for_messages(files, original, output, callbacks, waiting, queued, schedulers, result) do
+  defp wait_for_messages(entries, original, output, callbacks, waiting, queued, schedulers, result) do
     receive do
       { :struct_available, module } ->
         available = for { :struct, pid, _, waiting_module } <- waiting,
-                        waiting_module == module,
+                        module == waiting_module,
+                        not pid in entries,
                         do: pid
 
-        spawn_compilers(available ++ files, original, output, callbacks,
+        spawn_compilers(available ++ entries, original, output, callbacks,
                         waiting, queued, schedulers, [{ :struct, module }|result])
 
       { :module_available, child, ref, file, module, binary } ->

  end

  # We already have 4 currently running, don't spawn new ones
  defp spawn_compilers(files, original, output, callbacks, waiting, queued, schedulers, result) when
      length(queued) - length(waiting) >= schedulers do
    wait_for_messages(files, original, output, callbacks, waiting, queued, schedulers, result)
  end

  # Release waiting processes

            end
          end

          IO.puts "\nOne of the failures is shown below..."
        end

        IO.puts "== Compilation error on file #{file} =="
