fixed a few corner cases for shortest path algorithm. Included license file