 
   defp handle_down(queued, ref, reason) do
     case List.keyfind(queued, ref, 1) do
-      {_child, ^ref, file, _timer_ref} ->
+      {child_pid, ^ref, file, _timer_ref} ->
         print_error(file, :exit, reason, [])
-        terminate(queued)
+
+        queued
+        |> List.keydelete(child_pid, 0)
+        |> terminate()
+
         {:error, [to_error(file, :exit, reason, [])]}
 
       _ ->

  end

  defp terminate(queued) do
    for {pid, _, _, _} <- queued do
      Process.exit(pid, :kill)
    end
  end

  defp print_error(file, kind, reason, stack) do

        discard_down(child_pid)
        print_error(file, kind, reason, stack)
        cancel_waiting_timer(queued, child_pid)

        queued
        |> List.keydelete(child_pid, 0)
        |> terminate()

        {:error, [to_error(file, kind, reason, stack)], warnings}

      {:DOWN, ref, :process, _pid, reason} ->
