Fix some bugs in RoadGraphDatabase.