Lots of fixes for PrettyPrintTG