fix minor bugs on BSig and Runtime