I'm currently in the process of familiarising myself with some basic concepts of general relativity and have stumbled upon a problem that is probanly quite simple. I'm referring to the book by Hobson, p.541 and 548, where the energy-momentum tensor for a simple matter field action $S$, $$T_{\mu\nu} = \frac{2}{\sqrt{-\det g}}\frac{\delta S}{\delta g^{\mu\nu}},$$ is calculated as an example:
$$ S = \int d^4x\sqrt{-\det g}(\frac{1}{2}g^{\mu\nu}(\nabla_\mu \Phi)(\nabla_\nu \Phi)-V(\Phi)) $$ $$ \delta(\det g) = \det g^{\mu\nu}\delta g_{\mu\nu} = -\det g g_{\mu\nu}\delta g^{\mu\nu} \Rightarrow \delta\sqrt{-\det g} = -\frac{1}{2}\sqrt{-\det g}g_{\mu\nu}\delta g^{\mu\nu} $$ \begin{eqnarray} \delta S &=& \int d^4x[\sqrt{-\det g}\frac{1}{2}\delta g^{\mu\nu}(\nabla_\mu \Phi)(\nabla_\nu \Phi) + \delta(\sqrt{-\det g})(\frac{1}{2}g^{\alpha\beta}(\nabla_\alpha \Phi)(\nabla_\beta \Phi)-V(\Phi))] \\ &=& \int d^4x\sqrt{-\det g}\frac{1}{2}[(\nabla_\mu \Phi)(\nabla_\nu \Phi) -g_{\mu\nu}(\frac{1}{2}g^{\alpha\beta}(\nabla_\alpha \Phi)(\nabla_\beta \Phi)-V(\Phi))]\delta g^{\mu\nu} \end{eqnarray}
and one has $T_{\mu\nu} = [...]_{\mu\nu}$
My problem now is: if I calculate $$T^{\mu\nu} = \frac{2}{\sqrt{-\det g}}\frac{\delta S}{\delta g_{\mu\nu}}$$ in the same way, using the first term for $\delta\sqrt{-\det g}$ instead of the second, I find the same term for $T$ as before (with the indices up, of course), but with a plus instead of a minus between the derivatives-term and the Lagrangian-term in $T$.
But this is wrong, isn't it? So what am I doing wrong?