Modified debug messages. Allow for graceful shutdown.