fix comparison bugs, also add some more missing features for complex numbers/complex ndarrays