Replaced real() and imag() occurances with REAL() and IMAG() macros to work around C++98/C++11 ABI incompatibilities.