Fix a bug; still beta-mismatch

fix a bug

fix a potential bug
Add Make_test