Add unit tests for the Stats() method. Fix #707