Added some error messages, added code for beta distribution (still incomplete).