Fix a bug in the comparision method.