Fixed a few bug found on the BBB.