Moved segment clone and spanner deep copy outside of staff loop.