Fixing bugs in ingore_weights implementation in shortest path