Fix bug in UrlGenerator