Added more debug traces to shutdown sequence