* Address windows compilation error * Do not allow divide by zero in weight calculation * Update tests