fix NPE with stats.