Bug fix: use log instead of log10 in chi2 calculation