Fix error when no path in graph
Add more tests for the Graph class