Fix string -> int conversion in stats.py