Merge "Fix error handling in StatsEvent"