`single_source_shortest_path_length` returns a map (not a plain object), so the following lines won't work as expected. But I guess you will notice this when you run the tests :)