Fix crashes in recent stats system.