Undef the stat method before redefining it, and corrected to make it a singleton method.
Some updates/corrections for the stat tests.