Found and fixed another bug in power grid calculation