zfree(dv);
             if (dstkey) {
                 deleteKey(c->db,dstkey);
-                addReply(c,shared.ok);
+                addReply(c,shared.czero);
             } else {
                 addReply(c,shared.nullmultibulk);
             }
 
     string compare [lindex $a 1] [lindex $b 1]
 }
 
+proc waitForBgsave r {
+    while 1 {
+        set i [$r info]
+        if {[string match {*bgsave_in_progress:1*} $i]} {
+            puts -nonewline "\nWaiting for background save to finish... "
+            flush stdout
+            after 1000
+        } else {
+            break
+        }
+    }
+}
+
 proc main {server port} {
     set r [redis $server $port]
     $r select 9
 
     test {SAVE - make sure there are all the types as values} {
         # Wait for a background saving in progress to terminate
-        while 1 {
-            set i [$r info]
-            if {[string match {*bgsave_in_progress:1*} $i]} {
-                puts -nonewline "\nWaiting for background save to finish... "
-                flush stdout
-                after 100
-            } else {
-                break
-            }
-        }
+        waitForBgsave $r
         $r lpush mysavelist hello
         $r lpush mysavelist world
         $r set myemptykey {}
         } {0}
     }
 
+    test {BGSAVE} {
+        $r flushdb
+        $r save
+        $r set x 10
+        $r bgsave
+        waitForBgsave $r
+        $r debug reload
+        $r get x
+    } {10}
+
     # Leave the user with a clean DB before to exit
     test {FLUSHDB} {
         set aux {}