Index: trunk/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- trunk/Nebulous/lib/Nebulous/Client.pm	(revision 24927)
+++ trunk/Nebulous/lib/Nebulous/Client.pm	(revision 24930)
@@ -360,7 +360,12 @@
 
     my $locations;
+    my $removed = 0;
     eval {
         # first - strip off any inaccesible instances
-        $self->prune($key);
+        if (not defined $self->prune($key)) {
+            # use the prune() method to also determine if $key is valid
+            $removed = undef;
+            return;
+        }
 
         # check to see if there is an instance on $vol_name that should be the
@@ -375,10 +380,14 @@
                 next if $victim eq $locations->[0];
                 $self->delete_instance($key, $victim);
+                $removed++;
             }
         } else {
             # nuke whatever
-            my @stats = $self->stat($key);
-            foreach (1 .. $stats[6]) {
+            my $stats = $self->stat($key);
+            # start at one so cull() is called one less time then the # of
+            # instances
+            for (my $i = 1; $i < $stats->[6]; $i++) {
                 $self->cull($key);
+                $removed++;
             }
         }
@@ -391,5 +400,5 @@
     $log->debug("leaving");
 
-    return $locations->[0];
+    return $removed;
 }
 
Index: trunk/Nebulous/lib/Nebulous/Client.pod
===================================================================
--- trunk/Nebulous/lib/Nebulous/Client.pod	(revision 24927)
+++ trunk/Nebulous/lib/Nebulous/Client.pod	(revision 24930)
@@ -35,5 +35,6 @@
     my $mounts = $neb->mounts();
     my $mode = $neb->chmod( $key, $mode );
-    my $dead = $neb->prune( $key );
+    my $n_dead = $neb->prune( $key );
+    my $n_dead = $neb->there_can_be_only_one( $key, $vol );
 
 =head1 DESCRIPTION
@@ -419,5 +420,25 @@
 =back
 
-The number of inaccessible instances removed:
+The number of instances removed.
+
+=item * there_can_be_only_one($key, $vol)
+
+Removes all but one instance of an object and automatically removes any
+inaccessible instances.
+
+=over 4
+
+=item * key
+
+The storage object key (name).
+
+=item * vol
+
+If specified, the only remaining instance will be left on this volume (if an
+instance already exists there).
+
+=back
+
+The number of avaiable instances removed.
 
 =item * mounts()
@@ -479,5 +500,5 @@
 =head1 COPYRIGHT
 
-Copyright (C) 2004-2008  Joshua Hoblitt.  All rights reserved.
+Copyright (C) 2004-2009  Joshua Hoblitt.  All rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under
