Changes to get correct normalization in bayesutils