Fixed some stats functions