When tags such as vendor id have string information, -addToTitle will return a 0. To avoid this,

modify getData to return a string instead of a double:

static string getData(SDMol& mol, const string& tag)
    if (!mol.HasSDData(tag))
        return "";

    stringstream str(mol.GetSDData(tag));
    return str.str();

Then change createCombined (and other routines that call getData) to receive string values for tags instead of double:

rmsd = atof(getData(mol, "RMSD").c_str());
mw = atof(getData(mol, "molecular weight").c_str());
w = atof(getData(mol, "pharmacophore_match_weight").c_str());

and so on.

-Kaushik