Fixed some uses of quoteName to quote.
Removed quoteName where not necessary (aliased tables).