Fix tests for URL rewriting and rewriting itself.