Manual merge of changes from bernoulli-numbers branch to bernoulli-tgamma branch.