       {:DOWN, ref, :process, pid, reason} when is_map_key(spawned, ref) ->
         # async spawned processes have no file, so we always have to delete the ref directly
         spawned = Map.delete(spawned, ref)
-        waiting = delete_waiting(waiting, pid)
+        waiting = Map.delete(waiting, pid)
         {file, new_spawned, new_files} = discard_file_pid(spawned, files, pid)
 
         if file do

      end

    {available, Map.put(result, {kind, module}, value)}
  end

  defp delete_waiting(waiting, pid) do
    Map.delete(waiting, pid)
  end

  defp update_timing(files, pid, key) do


        # We may have spurious entries in the waiting list
        # if someone invoked try/rescue UndefinedFunctionError
        new_waiting = Map.delete(waiting, child_pid)
        spawn_workers(queue, new_spawned, new_waiting, new_files, result, warnings, state)

      {:file_cancel, child_pid} ->
