some fixes for statistics