Fixed crash and changed writePlaylist to write the full file path of the file.