Fix document.bundles iteration