Added better logging and reporting.