Improvements to code to capture some unhandled errors and avoid some others that occur when shutting down the bus.
Just fixing some incorrect code indentation.