partial fix for #39: removed new() with function_wrapper in Bagging APIs