Improved sql type conversions. refs #452