fix bugs in discrete dists