Fixed bug in dispatcher ignoring the distance priority.