Fix crash bugs with empty playlist