check both type and data_type to determine if loose typing is needed. Closes #339