Correcting equality comparision