Fixed the iteration issue in CS, trees