Fixed edgeDistance Matrix nullPointerException