improved handling of <base> tag (there could be <base> tags without href set)