Fix bug in BundleStore and add regression test