Fix header tags and escape quotes