Serious refactoring hazard here. 

Because of hosting, the `files.length` you're reading is the length of `files` _before_ it's transformed into an `Array` (if necessary):

```js
function f(a) { 
  if ( Array.isArray(a) ) { 
    a = [a]; 
  } 

  var t = typeof a, l = a.length; 

  return [ t, l ]
}

f("the length is 16");

// [ string, 16 ]
```