Fix url dispatching algorithm.