Cast $uri to a string (refs #4689)