Fix up of some code mess from the bundle NPE fixes.