     #
     if @isSyncKey key
       @storage.set @mkKeyValue(key,value), =>
+        # Chrome sets chrome.runtime.lastError if there is an error.
         if chrome.runtime.lastError
-          @log "chrome sync callback for Sync.set() indicates error: " + key
-          @log chrome.runtime.lastError
+          console.log "chrome sync callback for Sync.set() indicates error: " + key
+          console.log chrome.runtime.lastError
       @log "set scheduled: #{key}=#{value}"
 
   # Only called synchronously from within vimium, never on a callback.
   clear: (key) ->
     if @isSyncKey key
-      @storage.remove key, ->
+      @storage.remove key, =>
+        # Chrome sets chrome.runtime.lastError if there is an error.
         if chrome.runtime.lastError
-          @log "chrome sync callback for Sync.clear() indicates error: " + key
-          @log chrome.runtime.lastError
+          console.log "chrome sync callback for Sync.clear() indicates error: " + key
+          console.log chrome.runtime.lastError
 
   # Should we synchronize this key?
   isSyncKey: (key) ->


#
# * Sync.set() and Sync.clear() propagate local changes to chrome.storage.sync.
# * Sync.listener() listens for changes to chrome.storage.sync and propagates those

  # Asynchronous fetch from synced storage, called only at startup.
  pull: ->
    @storage.get null, (items) =>
      # Chrome sets chrome.runtime.lastError if there is an error.
      if chrome.runtime.lastError is undefined
        for own key, value of items
          @log "pull: #{key} <- #{value}"
          @storeAndPropagate key, value
      else
        console.log "chrome sync callback for Sync.pull() indicates error"
        console.log chrome.runtime.lastError

  # Asynchronous message from synced storage.
  listener: (changes, area) ->
