Fix order of stages in a pipeline