Good point about the mounting tab not being at ground potential on the LM317T and LM338T.
It is at output voltage potential in both, and must be isolated from your heatsink if grounded..
Those regulators (7805, 7809, 7812, etc.) with the mounting tab at ground potential
Have all lulled us into bad heatsinking practices.
73, Jim K9GCS