Fix various bugs in organization_stats.py