Fix infinite loop caused by not using Uri properly.

And caused by PHP not complaining when I call a static method on an object