After line 2 you could argue that you need to change need to convert e^{\frac{3i\pi}{2}} to be in the range (-\pi, \pi] aka e^{\frac{-i \pi}{2}}
So that when you take the squareroot, the result is in the principal argument range (-\frac{\pi}{2}, \frac{\pi}{2}] to ensure that the real value...