fix minor bugs in BSig engine