Fixed up route matching and added a test for it.