fix BMA helpers and test case