Fixing a bug with greedy route