   #
   # Returns int
   llen: (key) ->
-    Q(@data._private[@key key].length)
+    Q(@data._private[@key key]?.length)
 
   # Public: set the list value at the specified index
   #
   # Returns promise
   lset: (key, index, value) ->
+    key = @key key
+
+    if not @data._private[key]
+      @data._private[key] = []
+
     @data._private[@key key][index] = @serialize value
     Q @
 

  #
  # Returns promise
  linsert: (key, placement, pivot, value) ->
    key = @key key
    if @data._private[key] isnt undefined
      index = _.find @data._private[key], pivot

      if index
        @data._private[key].splice 0, placement is 'AFTER' ? index + 1 : index, @serialize(value)

    Q @

  # Public: push a new value onto the left-side of the list
  #
  # Returns promise
  lpush: (key, value) ->
    key = @key key
    if @data._private[key] is undefined
      @data._private[key] = []

    @data._private[key].unshift(@serialize value)
    Q @

  # Public: push a new value onto the right-side of the list
  #
  # Returns promise
  rpush: (key, value) ->
    key = @key key
    if @data._private[key] is undefined
      @data._private[key] = []

    @data._private[key].push(@serialize value)
    Q @


  #
  # Returns promise for int
  scard: (key) ->
    Q @data._private[@key key]?.length

  # Public: Get and remove a random member from the set
  #
  # Returns promise for a set member
  spop: (key) ->
    key = @key key
    index = _.random 0, @data._private[key]?.length - 1
    item = @data._private[key]?[index]

    @data._private[key]?.splice(1, index)

    Q item

