a bunch more fixes to TPTMP