no junction fix and OOM in inner_dist calc