some fixes to bayes.py