Fix typing error in scorer
Avoid duplicate work in C++ entropy computation