Make sure sign is consistend in 2 gid comparisons.