phaseIdx in this for statement is actual active phase index, should not active once again.

This will be a  problem when there is oil-gas system and water-gas system(of course, the simulator doesn't support water-gas system).