Problem
Find $\mathrm{Aut}(G)$, $\mathrm{Inn}(G)$ and $\mathrm{Aut}(G)/\mathrm{Inn}(G)$ for $G = D_4$
My Attempt
I let $D_4 = \{e, x, y, y^2, y^3, xy, xy^2, xy^3\}$
I found that $\mathrm{Inn}(G)$ consists of 4 bijective conjugation functions, namely $\{\phi_e, \phi_x, \phi_y, \phi_{xy}\}$. For $\mathrm{Aut}(G)$, I found that there are 12 automorphisms.
Here is the following link that relates to the problem I am doing.
Based on the solution:
Lemma: If $\alpha$ is an automorphism of group $G$ and $G$ has generators $x$ and $y$ with orders $n$ and $m$, respectively then $\alpha(x)$ and $\alpha(y)$ are also generators for $G$ with orders $n$ and $m$.
Proof: First, let us show that the orders agree. If $g \in G$ has order $n$, let $a = \alpha(g) \in G$ have order $m$. Then, $a^m = 1$ but by applying $\alpha^{-1} \in \mathrm{Aut}(G)$, we get $g^m = 1$. However, $g$ has order $n$, so $n$ must divide $m$. Similarly, $g^n = 1$ and applying $\alpha$, we note that $a^n = 1$, and so we conclude $n = m$.
Secondly, since any element of $G$ can be written as a product of $x$'s and $y$'s, and $\alpha$ is a surjective homomorphism, it follows that any element of $G$ can also be written as a product of $\alpha(x)$ and $\alpha(y)$, hence they generate $G$.
Using this Lemma (or a similar argument), we note that an automorphism of $D_4$ must send $y$ to $y, xy, x^2y$ or $x^3y$ and $x$ to $x$ or $x^3$. Any such pairing is possible, thus there are $2 \cdot 4 = 8$ such automorphisms...
(The notations that someone use are different from what I denote.)
The question I have is: Why are there 8 automorphisms? Shouldn't there be 12 automorphisms? Here is what I have:
$$e \mapsto e$$ $$x \mapsto \text{ either } \{x,y^2, xy^2\}$$ $$y \mapsto \text{ either } \{y, y^3, xy, xy^3\}$$
Then, there are $1 \cdot 3 \cdot 4 = 12$ automorphisms.
Any advices or comments?