Fixed massive bug in the EnergyNetwork code that caused massive power wastage