Update version number and minor details.
Fix stats computation, and clear up the code