quite minor
patched one of the very important possible source of bug, on preparing data to be called for weighted sum