anchor.diff:      N = byte_size(Prefix),
   
       fun (DbName) ->
  -            try
  -                ActualPrefix = binary:part(DbName, 0, N),
  -                ActualPrefix =:= Prefix
  -            catch
  -                %% can happen when DbName is shorter than expected prefix
  -                error:badarg ->
  +            case DbName of
  +                <<ActualPrefix:N/binary, _/binary>> when ActualPrefix =:= Prefix ->
  +                    true;
  +                _ ->
                       false
               end
       end.
  
positive.code: 
  delete_databases_and_files(Bucket) ->
      AllDBs = bucket_databases(Bucket),
      Suffix = <<"/master">>,
      SuffixLen = erlang:size(Suffix),
      {MaybeMasterDb, RestDBs} = lists:partition(
                              fun (Name) ->
                                      NameLen = erlang:size(Name),
                                      case NameLen < SuffixLen of
                                          true -> % this would cause a badarg
                                              false;
                                          false ->
                                              SuffixC = binary:part(Name,
                                                                    NameLen, -SuffixLen),
                                              SuffixC =:= Suffix
                                      end
                              end, AllDBs),
      case delete_databases_loop(MaybeMasterDb ++ RestDBs) of
          ok ->
  
negative.code:                   end
            end, []),
  
      BucketDbs2 = [D || D <- couch_server:all_known_databases(),
                         Pred(D)],
  
      lists:umerge(lists:usort(BucketDbs),
                   lists:usort(BucketDbs2)).
  
  delete_couch_database(DB) ->
      RV = couch_server:delete(DB, []),
  