matchRoute: fix returned path and fix tests