Added more logging for shutdowns.