Workout builder

Hi! I am having trouble editing workouts with the Main set looped. Seems like the repeats are created only if no other lines are written before the loop. Moreover, the step created after the loop is erroneously incorporated in the loop. I attach pictures to make it clearer. Thank you in advance!
Michele