Fix dispatcher restoration.
Fix bayes algorithm.