Added support for generating reports.
Fix for shutdown hanging when called without any prior activity.