           @renderCtx[name] = img
           if _.every(imageNames, (n)=> @renderCtx[n]?)
             @ready = true
-            @setImmediate(cb)
+            @defer(cb)
           return
         img.src = data
     return

      f(context2d, @renderCtx)
    return

  render: (context2d, cb)->
    unless @ready
      throw new Error('Painter not yet ready.')
    @rendering = true

    imageNames = _.keys(@plan.i)
    if imageNames.length == 0
      @ready = true
      @defer(cb)
    for name, data of @plan.i
      do (name, data) =>
        img = new Image()
