Fix get_prodes_stats and its test.