Fixed brain error in DiscreteDistribution and added Test function.