Collecting stats and displaying proper errors