Carbon and oxygen controls on N2O and N2 production during nitrate reduction