correct some errors in bundle loading