fix bug in compare compartments for a given point.