Fix inequality comparision

Ensure that for quantities x and y x==y is the logical opposite of x!=y.