NPE fix in statistics tracking