add input checking for Bernoulli and Binomial, add tests