Ensuring uniqueness of URLs, various improvements