Minor fixes involving expicit table qualifications
Simplify and improve Id types