bugfixes to cuda bayes