Fixed and tested shutdown circuit and routine.