Improved nil-catching; added total counts
More nil-catching fixes. Solved.
Improved statistics summary output with total counts.