When loading the DLL the static initialization order is compiler-dependent.
By having StatsCounter objects at the global level they were created before
the Statistics (another global, static object) instance was available.
A longer-term fix would be creating the Statistics instance on demand, during
the getInstance() call, using something like InitOnceExecuteOnce().