     end
   end
 
-  defp downgrade_directives_supervisor(v1, v2, m, beam) do
+  defp downgrade_directives_supervisor(beam, v1, v2, m) do
     case beam_exports(beam, :sup_downgrade_notify, 2) do
       true ->
         [ {

        ]
      }

    info "Generated .appup for #{application} #{v1} -> #{v2}"
    { :ok, appup }
  end

    end
  end

  defp downgrade_directives(beam, v1, v2, m) do
    case is_supervisor(beam) do
      true ->
        downgrade_directives_supervisor(beam, v1, v2, m)
      false ->
        case has_code_change(beam) do
          true  -> [ { :update, m, :infinity, { :advanced, [] }, :brutal_purge, :brutal_purge, [] } ]
