Further improvements to Teradata support #561