Fix bug in determining whether edge touches partition.