BaggingWrapper: fix handling of weights