Improve Teradata support #561