Minor reordering of steps.