stats_utils: couple of bug fixes