   # Goes through the queue and processes files if there aren't too many already.
   processQueue: ->
     parallelUploads = @options.parallelUploads
-    processingLength = @files.processing.length
+    processingLength = @filesProcessing.length
     i = processingLength
 
     while i < parallelUploads
-      return  unless @files.queue.length # Nothing left to process
-      @processFile @files.queue.shift()
+      return  unless @filesQueue.length # Nothing left to process
+      @processFile @filesQueue.shift()
       i++
 
 
   # Loads the file, then calls finishedLoading()
   processFile: (file) ->
-    @files.processing.push file
+    @filesProcessing.push file
     file.processing = yes
 
     @emit "processingfile", file



    @files = [] # All files
    @files.queue = [] # The files that still have to be processed
    @files.processing = [] # The files currently processed
    @URL = window.URL ? window.webkitURL
    @setupEventListeners()


  # Called internally when processing is finished.
  # Individual callbacks have to be called in the appropriate sections.
  finished: (file, responseText, e) ->
    @filesProcessing = without(@filesProcessing, file)
    file.processing = no
    @processQueue()
    @emit "success", file, responseText, e
    @emit "finished", file, responseText, e # For backwards compatibility
    @emit "complete", file


  # Called internally when processing is finished.
  # Individual callbacks have to be called in the appropriate sections.
  errorProcessing: (file, message) ->
    @filesProcessing = without(@filesProcessing, file)
    file.processing = no
    @processQueue()
    @emit "error", file, message
    @emit "complete", file



