Fix segmentation fault in BA. #2