Fixed remaining bug when shutting down (when using serial trigger).