Fixed typo in export script related to column names.
Cleaned out SQL templates to be more consistent.