Fix ArrayOutOfBoundException when number of rects is zero in mergeLinks(). Fix line endings ArrayList --> List