Remove <base> and fix header/footer parsing bug