 
   lock: (exclusive, address, leaf, callback) ->
     if not tier = @cache[address]
-      tier = @link({ leaf, address, objects: {}, addresses: [], locks: [[]] })
+      tier = @link({ leaf, address, cache: {}, addresses: [], locks: [[]] })
     locks = tier.locks
     if tier.loaded
       lock = callback

extractor = (a) -> a

class IO
  constructor: (@directory) ->
    @cache          = {}
    @head           = { address: -1 }
    @head.next      = @head

  # TODO: Reading through the code, this does not take this into account, and
  # will problably send items that belong in the least value tree into the three
  # that follows it. I'll clean this up with unit testing.
  find: (tier, _) ->
    size = tier.addresses.length
    if tier.leaf
      [ low, high, offset ] = [ 0, size - 1, 0 ]
    else if size is 1
      return 0
    else
      [ low, high, offset ] = [ 1, size - 1, 1 ]
    { comparator, fields, io } = @
    loop
      mid = (low + high) >>> 1
      compare = comparator fields, io.key(tier, mid, _)
      if compare is 0
        break
      if compare > 0
        low = mid + 1
      else
        high = mid - 1
    if compare is 0
      while mid != 0 && comparator(fields, io.key(tier, mid - 1, _)) == 0
        mid--
    return mid

  mutate: (_) ->
    address = 0
