 
         if write_updates
             #@dbg("_process_updates","writing our own updates back")
-            @_write_updates_to_db(cb)  # safe to call skipping lock, since we have the lock
+            # safe to call skipping lock, since we have the lock
+            @_write_updates_to_db (err) =>
+                cb(err, true)
         else
             #@dbg("_process_updates","no further updates from us (stable)")
-            cb()
-
-        return true  # there were patches to apply
+            cb(undefined, true)
+
 
     _squash_patches: (opts) =>
         opts = defaults opts,

                if err
                    cb(err)
                else
                    new_updates = @_process_updates updates, (err) =>
                        # ignore err, since it would be in writing back
                        cb(undefined, new_updates)


                    new_patches[update.string_id].push(update)

        if misc.len(new_patches) == 0
            @dbg("_process_updates", "no new patches, so nothing further to do")
            cb(undefined, false)
            return

        #if updates.length > 0
        #    @dbg("_process_updates",misc.to_json(new_patches))
        @dbg("_process_updates", "#{misc.len(new_patches)} new patches")

        # There are new patches
        write_updates = false
