More polish on encoding pg and html.