fix Python statistics reporting code