check both type and data_type to determine if loose typing is needed. Closes #339
Merge branch '1.6/master' into 1.7/master