Clean up and fix MCStats library