Remove error at shutdown when debug mode is set