Fixed divide by zero in network energy balance