(CDB) Fix bug in statistics when there is no group