Averting failures in HV and MV systems