Improve bntest slightly, and fix another bug in the BN library.