Add test and fix problem in register_bundle