Applying statistics patch from NPH - fc285d2849cd07ae8e1ea28709e5aee2dd4eeb82