Fixes to flash algorithm and Gibbs Minimization 3P code refactoring.