Added improved error handling when the playlist is empty.