Fix various scalar type conversion warnings.