Clean up and report writing