Fixed calcAdjacencies.
Fixing the tests.