anchor.diff:  cleanup(Test, CleanupFun, setup) ->
       %% Remove existing ring files so we have a fresh ring
       os:cmd("rm -rf " ++ Test ++ "/ring"),
  -    cleanup(Test, CleanupFun, ok);
  -cleanup(Test, CleanupFun, _) ->
  +    cleanup(Test, CleanupFun, []);
  +cleanup(Test, CleanupFun, StartedApps) ->
       Deps = lists:reverse(dep_apps(Test, CleanupFun)),
  -
  -    %% Stop the applications in reverse order
  -    do_dep_apps(stop, Deps),
  +    Apps = Deps ++ lists:filtermap(fun(A) ->
  +                                           not lists:member(A, Deps)
  +                                   end, lists:reverse(StartedApps)),
  +
  +    %% Stop the applications in reverse order.
  +    do_dep_apps(stop, Apps),
   
       %% Cleanup potentially runaway processes
       catch exit(whereis(riak_kv_vnode_master), kill),
  
positive.code:     net_kernel:start([TestNode, longnames]),
  
      %% Start dependent applications
      do_dep_apps(start, Deps),
  
      %% Wait for KV to be ready
      riak_core:wait_for_application(riak_kv),
      riak_core:wait_for_service(riak_kv),
      ok.
  
  %% @doc Performs generic, riak_kv-specific and test-specific cleanup
  %% when used within a test fixture. This includes stopping dependent
  
negative.code:            (_) -> ok
          end,
  
      [sasl, Silencer, runtime_tools, erlang_js, mochiweb, webmachine,
       sidejob, poolboy, basho_stats, bitcask, lager, folsom, protobuffs,
       eleveldb, riak_core, riak_pipe, riak_api, riak_dt, riak_pb, riak_kv,
       DefaultSetupFun, Extra].
  
  
  %% @doc Runs the application-lifecycle phase across all of the given
  %% applications and functions.
  %% @see dep_apps/2
  -spec do_dep_apps(load | start | stop, [ atom() | fun() ]) -> [ any() ].
  do_dep_apps(start, Apps) ->
      lists:foldl(fun(A, Acc) when is_atom(A) ->
                          case include_app_phase(start, A) of
                              true ->
                                  {ok, Started} = start_app_and_deps(A, Acc),
                                  Started;
                              _ ->
                                  Acc
                          end;
                      (F, Acc) ->
                         F(start),
                         Acc
                 end, [], Apps);
  do_dep_apps(LoadStop, Apps) ->
      lists:map(fun(A) when is_atom(A) ->
                        case include_app_phase(LoadStop, A) of
                            true ->
                                application:LoadStop(A);
                            _ ->
                                ok
                        end;
                   (F) ->
                        F(LoadStop)
                end, Apps).
  
  %% @doc Determines whether a given application should be modified in
  