Fix bug in stats method