Fix bug into f_bdt_body, f_dw, f_bdt, add test for bdt_body,