Fixed erronous behaviour in getNeighbours method.