diff --git a/lib/poolparty/cloud.rb b/lib/poolparty/cloud.rb
index <HASH>..<HASH> 100644
--- a/lib/poolparty/cloud.rb
+++ b/lib/poolparty/cloud.rb
@@ -277,11 +277,11 @@ No autoscalers defined
     # Run command/s on all nodes in the cloud.
     # Returns a hash of instance_id=>result pairs
     def cmd(commands, opts={})
-      opts[:key_by]= :instance_id unless opts[:key_by]
+      key_by = opts.delete(:key_by) || :instance_id
       results = {}
       threads = nodes.collect do |n|
-        puts "result for #{n.instance_id} ==> #{n.ssh(commands, opts)}"
-         Thread.new{ results[ n.send(opts[:key_by]) ] = n.ssh(commands, opts) }
+        puts "result for #{n.instance_id} ==> n.ssh(#{commands.inspect}, #{opts.inspect})"
+        Thread.new{ results[ n.send(key_by) ] = n.ssh(commands, opts) }
       end
       threads.each{ |aThread| aThread.join }
       results
Fix Cloud#cmd to avoid injection of the text "key_by instance_id" into the generated ssh command