Fix matching routes with similar prefixes.

Should resolve #2