Fix invalid HTML issues