Fix #572 - Stat Database max row before purge

Tested, works.