Fix statistics bug