Linked stats to database. [#56405906]
Fixed test issues on stat_factory. [#56405906]