bugfix sum-prod wrapper libdai