   # default value to it instead.
   rename: (oldKey, newKey, defaultValue) ->
     if @exists oldKey
-      @init newKey, @get oldKey
+      @set newKey, @get oldKey
       @remove oldKey
     else
-      @init newKey, defaultValue
+      @set newKey, defaultValue
 
   # Search `localStorage` for all keys that match the specified regular
   # expression.

    return no for key in keys when not localStorage.hasOwnProperty key
    yes

  # Retrieve the value associated with the specified `keys` from
  # `localStorage`.  
  # If the value is found, parse it as JSON before being returning it;
  # otherwise return `undefined`.
  get: (keys...) ->
    if keys.length is 1
      value = localStorage[keys[0]]
      if value? then JSON.parse value else value
    else
      value = {}
      value[key] = @get key for key in keys
      value

  # Initialize the value of the specified key(s) in `localStorage`.  
  # `keys` can either be a string for a single key (in which case

  # key; otherwise transform it to a JSON string beforehand.
  set: (keys, value) ->
    switch typeof keys
      when 'object' then @set key, value for own key, value of keys
      when 'string'
        oldValue = @get keys
        localStorage[keys] = tryStringify value
        oldValue

# Utilities setup
