Fix bad url resolution.

I have also updated the unit tests to check url resolution. Let me now if it is ok