Added more sed'ing, URLencoding.