Fixed issues with sample_from_likelihoods and sample_beta