Fix getting file name from url, adjust tests.