complex proof not sure

There's this problem in my homework, I did it, but somehow it just doesn't seem right. I wonder where the problem is... Please help me :)

Show that $\int_\gamma z^n dz=0$ for any closed smooth $\gamma$ and any integer $n\neq -1$. [If $n$ is negative, assume that $\gamma$ does not pass through the origin, since otherwise the integral is not defined.]

$\rightarrow$ Sol. Let $z=\gamma(t)$, $dz=\gamma'(t)dt$, $a\leq t\leq b$, $\gamma(a)=\gamma(b)$. Then: \begin{align*} &\int_\gamma z^n dz\\ =&\int_a^b\gamma(t)^n\gamma'(t)dt\\ =&\int_{\gamma(a)}^{\gamma(b)} z^n dz\\ =&\frac{z^{n+1}}{n+1}\bigg|_{\gamma(a)}^{\gamma(b)}\\ =&0\\ \end{align*}

What could the problem be? Thank you!

The problem could be with $n=-1$ only, because $\int 1/z=\ln z$ (instead of $z^0$), and that the logarithm is not well defined as function on $\Bbb C$, has countably infinite 'branches' because $$e^{2\pi i+z}=e^z$$ for all $z\in\Bbb C$. And, indeed $$\int_{|z|=1}\frac1z=2\pi i$$ and is not $0$. This is the base of the residue theorem and Cauchy's integral form, and many more..