Fix to the electrolyte flash algorithm