Bug fixes in adding stats