Fix sequence looping.