     File.open!(manifest, [:write], fn device ->
       :io.format(device, "~p.~n", [{:version, @manifest_vsn}])
 
-      for {beam, module, source, deps, files, binary} <- entries do
+      Enum.map entries, fn {beam, _, _, _, _, _, binary} = entry ->
         if binary, do: File.write!(beam, binary)
-        :io.format(device, "~p.~n", [{beam, module, source, deps, files}])
+        :io.format(device, "~p.~n", [put_elem(entry, 6, nil)])
       end
 
       :ok

                do: relative

    source = Path.relative_to(source, cwd)

    Agent.cast pid, &:lists.keystore(beam, 1, &1, {beam, module, source, deps, files, binary})
  end

  defp get_external_resources(module) do

  # This function receives the manifest entries and some source
  # files that have changed. It then, recursively, figures out
  # all the files that changed (via the module dependencies) and
  # return the non-changed entries and the removed sources.
  defp remove_stale_entries(all, []) do
    {all, []}
  end

  defp remove_stale_entries(all, changed) do
    remove_stale_entries(all, HashSet.new, Enum.into(changed, HashSet.new))
  end

  defp remove_stale_entries(entries, old_stale, old_removed) do
    {rest, new_stale, new_removed} =
      Enum.reduce entries, {[], old_stale, old_removed}, &remove_stale_entry/2

    if HashSet.size(new_stale) > HashSet.size(old_stale) or
       HashSet.size(new_removed) > HashSet.size(old_removed) do
      remove_stale_entries(rest, new_stale, new_removed)
    else
      {rest, Enum.to_list(new_removed)}
    end
  end

  defp remove_stale_entry({beam, module, source, compile, runtime, _f, _bin} = entry,
                          {rest, stale, removed}) do
    cond do
      # If I changed in disk or have a compile time dependency
      # on something stale, I need to be recompiled.
      source in removed or Enum.any?(compile, &(&1 in stale)) ->
        _ = File.rm(beam)
        _ = :code.purge(module)
        _ = :code.delete(module)
        {rest, HashSet.put(stale, module), HashSet.put(removed, source)}

      # If I have a runtime time dependency on something stale,
      # I am stale too.
      Enum.any?(runtime, &(&1 in stale)) ->
        {[entry|rest], HashSet.put(stale, module), removed}

      # Otherwise, we don't store it anywhere
      true ->
        {[entry|rest], stale, removed}
    end
  end

  ## Manifest handling
