Get base instead of document.location.href if the tag is defined. Should fix #433