fixes incorrect indicies being returned from .dist.2dto1d