Fix reachability calc when edge matrix is large

- The resulting m in findReachableMat could contain Inf and/or NaN if
  the input m is large enough