Fixed a bug when increasing the capacity of the neighbors array, where an ArrayIndexOutOfBoundsException may occur, i.e. when older capacity eq 1.