Added check_alloc() in libbmrm.cpp and init() in bmrm_ll with a little cleanup