Adding more sanitation for creating error stats.