Improve reactive power calculation