Small tweaks to the generate_stats script.