Cleanup and better logging messages.