Handle bad URLs and filenames