Add stats unit tests.
Fix an uninitialized variable read in xallocx().