Fixed a bug in match_route_dp
"back_points[-1] is None" is now OK.