Support empty stages and stage reordering