SCPI errors can sometimes interrupt code and leave devices in strange states (ex - Keithley 2400 will throw an error and code will stop, but SMU will remain with output on). Code should be revisited to more elegantly catch and read these errors and shut down instruments appropriately.