Fix bug in bh_core.BhCore.match