Fixing bug in stats