Bugfix in stats.py for older pythons