Debugged the SurfaceNeighbors function.