Fixed imaginary number logic error