Bugs in dijkstra algorithm implementation removed.

Relevant Docstrings added.