Fix looping and setting playback range