Fixed typo in flatten.js

Looks like a bad argument for `getName(bundle)`, should be a `bundle`, not `bundle.bundles`. Without the fix, `getName()` raises an error when it does `var bundleNames = bundle.bundles.map(...)`.