fix for cases in which value_type is const double.