Remove the small imaginary part in the input of ZOpt.err from lsqnonlin