bugfix in toProbabilityDistribution