Added defensive code against very long URLs.