Correctly implement the selection of the phases to run