Fix matching routes with trailing slash (refs #532)