"Fixed" greedily matching {_missing} routes

Well this is an awfully hacky solution... or at least the way it is structured is. A more logical solution would be to use array_last instead of array_first when matching routes, but that has been tried and it had some problems.

#2850