fixed some bugs relating to relative URLs