*8015* Fixed problems when upgrading twice, introduced needed methods to purge and check stats records