Some fixes in stats