Some changes from the WorkflowPhase branch that could be separated out.