Fix bug 403: annealing can result in infinite energy errors
Fix bug 246: add factor function to FactorTable