fixed a bug in complex arithmetic