Fix for the crash at the end of playback.