Fixup relative URL resolving to work correctly