Density functional theory is widely used to predict materials properties, but the local density approximation and generalized gradient approximation exchange-correlation functionals are known to poorly predict the energetics of reactions involving molecular species. In this paper, we obtain corrections for the O2, H2, N2, F2, and Cl2 molecules within the Perdew-Burke-Enzerhof GGA, Perdew-Wang GGA, and Perdew-Zunger LDA exchange-correlation functionals by comparing DFTcalculated formation energies of oxides, hydrides, nitrides, fluorides, and chlorides to experimental values. We also show that the choice of compounds used to obtain the correction is significant, and we use a leave one out cross-validation approach to rigorously determine the proper fit set. We report confidence intervals with our correction values, which quantifies the variation caused by the choice of fit set after outlier removal. The remaining variation in the correction values is on the order of 1 kcal/mol, which indicates that chemical accuracy is a realistic goal for these systems.