   end
 
   defp terminate(queued) do
-    for {pid, _, _, _} <- queued do
-      Process.exit(pid, :kill)
-    end
+    for {pid, _, _, _} <- queued, do: Process.exit(pid, :kill)
+    for {pid, _, _, _} <- queued, do: discard_down(pid)
+    :ok
   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)
        terminate(queued)
        {:error, [to_error(file, kind, reason, stack)], warnings}

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


  defp handle_down(queued, ref, reason) do
    case List.keyfind(queued, ref, 1) do
      {child_pid, ^ref, file, _timer_ref} ->
        print_error(file, :exit, reason, [])

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

        {:error, [to_error(file, :exit, reason, [])]}

      _ ->
