You multiply componentwise without looking.
$\underline{a}\cdot\underline{a} = |\underline{a}|^2$ — recognise it every time it appears, especially inside an expansion. Expanding brackets with negative components is where the sign goes missing.
Next time: Read $\underline{a}\cdot\underline{a}$ as a magnitude squared.