Modeling adsorption phenomena on surfaces by DFT calculations often involves substantial errors, resulting in inaccurate predictions of catalytic activities. Such errors partly stem from the inaccurate description of the energetics of free molecules. Herein, we use a semiempirical group-additivity method to correct the DFT-calculated heats of formation of 106 carbonand nitrogen-containing gaseous compounds belonging to 15 different chemical families. PBE, PW91, RPBE and BEEF-vdW initially yield mean absolute errors (MAEs) with respect to experiments in the range of 0.32-0.75 eV. After correcting the systematic errors, the overall MAEs decrease to~0.05 eV. Additionally, upon applying the corrections to three types of reaction enthalpies, the resulting MAEs are below 0.10 eV. These functional-group corrections can be used in (electro)catalysis to correct the gas-phase references necessary to evaluate equilibrium potentials and adsorption energies, predict error cancellation, and assess conflicting experimental data.